VRTK: Cannot access protected member `UnityEngine.Texture.Texture()`

Environment

  • VRTK imported from the Unity Asset Store.
  • VRTK Version: 3.2.1
  • Version of Unity3D: 2018.1.0f2
  • Hardware used: HTC Vive
  • SDK used: SteamVR

Steps to reproduce

  • Import VRTK to the assets

Expected behavior

  • No error should come up.

Current behavior

  • I am getting two errors:
Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_MaterialColorSwapHighlighter.cs(146,66): error CS1540: Cannot access protected member `UnityEngine.Texture.Texture()' via a qualifier of type `UnityEngine.Texture'. The qualifier must be of type `VRTK.Highlighters.VRTK_MaterialColorSwapHighlighter' or derived from it
Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_MaterialColorSwapHighlighter.cs(146,66): error CS0122: `UnityEngine.Texture.Texture()' is inaccessible due to its protection level

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (1 by maintainers)

Most upvoted comments

I had the same issue… using this latest version with 2018.2.2f adjusting the line in question to this: “renderer.material.SetTexture(”_MainTex", new Texture2D(0,0));" fixed the issue for me : )

I will keep an eye open for an update to VRTK that works with 2018.2 +

That would mean you continue to use the VRTK version that is over a year old. Instead follow best practices to get the latest VRTK by getting it from the GitHub branch.