GetComponent and GameObject.Find stopped working
Hi there, I know there's a lot of answers to similar issues but I couldn't find any that helped. I have a player character and other scripts that access it, namely a game manager and some checkpoints. It all worked flawlessly until I changed the canvass to scale with screen size, then it got all messed up. Any ideas?
Code as follows:
public GameObject robObj;
public Robot robData;
(in Start)
//robData = GameObject.Find("Robot").GetComponent<Robot>(); original way that worked
//current, separate way to test where the problem is (apparently neither line works)
robObj = GameObject.Find("Robot");
robData = robObj.GetComponent<Robot>();
Yes, the GameObject is called "Robot" and the script is called Robot as well, case sensitive and all. I tried dragging the GO via inspector but even then the component doesn't show up.
I also made debug.logs to see which object is initialized first and the robot does outspeed the manager, I'm quite desperate as everything seems to be fine AND it actually did work before, it just got messed up last minute. Thanks in advance!