I have instanced a simple scrolling menu prefab in my scene (prefab provided by MRTK2 with just one menu option available). I have a button in the scene that when clicked will either SetActive(true)
or SetActive(false)
on this menu to show/hide it. When the menu is SetActive(false)
and then SetActive(true)
it provides the sequence of errors depicted in the picture below. I've found this
It seems that all of these errors are w.r.t. components on objects in the menu that existed from the prefab, so I'm confused as to why these errors are happening. I tried to replace the components with their MRTK counterparts as I was reading somewhere that MRTK versions of shaders, etc. are more efficient and was hoping that maybe they would simply solve the issue (they haven't).
For example, it seems that the error regarding MRTK_PressableInteractablesButtonBox (Instance) (Instance)
is the shader on the FrontPlate
of the button in the menu option.
Similarly, the error regarding sequisb SDF Material (Instance) (Instance)
is the FontAsset
on the TextMeshPro
under the menu option's IconAndText
object.
CodePudding user response:
Unfortunately, my solution doesn't provide an explanation as to what caused my original error. However, I was able to get everything working by simply scrapping the old menu and recreating from the same prefab. I guess cross-wiring must have occurred at some point that I was unable to trace down. Ultimately, all I needed was a scrollable menu with a click event listener and buttons with custom meshes...all of which seem to be working fine now.
Thanks to @Zuocheng Wang and @derHugo for pointing me in the right direction (i.e. that things "should" work essentially out-of-box for the desired functionality).