I have a simple script:
public GameObject icon;
void Update()
{
Debug.Log(icon.name);
}
Then i assign Icon GameObject in Unity inspector (when i click on this field while runtime, it's pointing to exact object). But i still recieving this error despite having right feedback in console:
Icon
UnityEngine.Debug:Log (object)
Interactable:Start () (at Assets/Scripts/Interactable.cs:18)
I tried: renaming Icon object, reloading Unity, recreate Icon object completly.
One more thing - when i put this Debug piece of code in different function (like OnMouseOver) in the same script it's works as intended.
So where i'm wrong?
↧