GameObject public
public GameObject myObject;
Yawning Yacare
public GameObject myObject;
//define "myObject"
//(asign in in inspector)
public GameObject myObject;
//runs when you hit the play button
void Start()
{
//change the name to "myObjectsNewName"
myObject.name = "myObjectsNewName";
}
//Note for Unity and C#
INSTEAD OF WRITING PUBLIC LIKE THIS:-
public GameObject object;
YOU CAN WRITE SERIALIZEFIELD LIKE THIS:-
[SerializeField] GameObject object;