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\$
7
  • \$\begingroup\$ Is the selectedOject a variable? \$\endgroup\$
    – John Smith
    Aug 5, 2015 at 18:41
  • \$\begingroup\$ yes its a transfrom \$\endgroup\$
    – Ryan Henry
    Aug 5, 2015 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\$
    – John Smith
    Aug 5, 2015 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, 2015 at 18:56
  • \$\begingroup\$ Maybe it should be changed to GetComponentInChildren<>().Select(); \$\endgroup\$
    – John Smith
    Aug 5, 2015 at 19:12

1 Answer 1

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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .