Using Unity 3.5.0b6 I have a game character GameObject called Player001Character, it has a child GameObject called TrackPlayer. If I use this code :
GameObject getTrackPlayer = GameObject.Find("/Player001Character/TrackPlayer");
It runs, but never finds TrackPlayer. For example, if I use this code :
getTrackPlayer.name = "New name";
I get an error message
NullReferenceException
How do I get the GameObject TrackPlayer if it is within a hierarchy (in the Hierarchy pane) ?
I’ve been to pages like this, which look like I’m doing it right :
http://unity3d.com/support/documentation/ScriptReference/GameObject.Find.html?from=index