I have a small problem that I’m not sure how to fix. In my scene, I have a main character and one cube. I applied a script to the cube that orders it to approach a (GameObject).
When I drag the main character game-object into the (GameObject) slot of the cube script, everything works fine; the cube travels towards the character.
However, when I instantiate the cube PREFAB, I cannot get the (GameObject) variable to refer to the main character in the scene.
I looking for a way of somehow saying:
var travelTo : Transform; travelTo = ("name_Of_The_Main_Character_GameObject_In_The_Hierarchy");
Thanks for the help