Using GameObject.Find with hierarchies in cSharp

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

It works fine.

This may be a dumb question, but you are sure that Player001Character is in the root of the scene, yes?

I would get into the debugger and make sure that GameObject.Find(“/Player001Character”) returns what you want, that it’s transform has children, and that one of them is called “TrackPlayer”, see what clues you get doing that.

Do This.

Add a tag to TackPlayer

http://unity3d.com/support/documentation/Components/Tags.html. Here is how to do that though I am sure you know.

Then use

GameObject getPlayerTrack= GameObject.FindWithTag(“TrackPlayer”);

Hope it helps