0
\$\begingroup\$

Okay I bought this asset online so I would like not to show the whole script. The problem is this asset stopped working when I updated from unity 5.0 to 5.1.2. The script is for a controller GUI interface but it seems to be giving me an error :

NullReferenceException: Object reference not set to an instance of an object UnityEngine.UI.Selectable.Select ()

on this line of code :

selectedOject.GetComponent<Button> ().Select ();

so there is a null reference and its no longer recognizing the child objects as buttons is what I'm assuming

if you want to have a better look at his set up he has a short video On youtube : HERE

I would like to continue to use this script and continue updating Unity.

\$\endgroup\$
  • \$\begingroup\$ Is the selectedOject a variable? \$\endgroup\$ – Vadim Tatarnikov Aug 5 '15 at 18:41
  • \$\begingroup\$ yes its a transfrom \$\endgroup\$ – Ryan Henry Aug 5 '15 at 18:41
  • \$\begingroup\$ Are you sure that the name of this variable matches the one on the line and that this variable stores something? \$\endgroup\$ – Vadim Tatarnikov Aug 5 '15 at 18:43
  • \$\begingroup\$ it does seem to be assigning to the right variable. Its supposedly assigning to the child objects \$\endgroup\$ – Ryan Henry Aug 5 '15 at 18:56
  • \$\begingroup\$ Maybe it should be changed to GetComponentInChildren<>().Select(); \$\endgroup\$ – Vadim Tatarnikov Aug 5 '15 at 19:12
0
\$\begingroup\$

Okay I was way off turns out the problem had nothing to do with the update at all. Apparently I deleted the event system that ran with this. So its working again

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.