This is getting to me because it seems to be something that just works but wont.
I have an empty scene with a floor. I created a new gameobject (cube) and called it MapIcon. I have an empty game object sitting in the scene called controller, and attached a script called CharacterMover.
In the script in the update function I have a simple ‘if button bushed then’ clause and inside it MapIcon.transform.Translate(vector3); but on running it doesn’t know what MapIcon is. I assumed that game objects in the same scene could be referenced like that?
So in my CharacterMover script I made var whatToMove : GameObject; and changed my code to read ‘if button pushed’ whatToMove.transform.Translate(vector3); but in the inspector it does not bring up the space for me to drag a game object into to set as this variable.
I have another script somewhere else that created a space in inspector to put game objects when I declared var something : GameObject; but wont do it here?
First question, how do you refer to game objects created in the same scene. Second, why is it not giving me the variable space in inspector?