Null Reference Exception problem

Writes that line 30 is Null. In v scrip i check everything that can be null. I only have i one of code there. Anyone know how to fix this?


You’re getting null reference exception because VracanjeNazad Isn’t part of the script’s gameobject
GetComponent works by getting a component from the object where script is attached to it.

You can assign VrancanjeNazad to the object or make it public to assign it manually