N game object with mesh but only 1 rotate

hi guys! sorry for the fancy subject, but i can’t explain in a better way… :slight_smile:
i have a game object (prefab) with a mesh and a script attached on it. the script simply aim the mesh to the player, ok?

so, when the game start, I instance some game object, but only the first game object’s mesh is aimed and the other no.

This is the script:

private var myGO: GameObject;

function Start()
{
   myGO = this.gameObject.Find("mesh"); // get mesh object at startup
}

function Update () 
{
   myGO.transform.LookAt(player.transform.position); // aim the mesh
}

Someone can help me? :slight_smile:

Thanks a lot and good work to everyone!

GameObject.Find() looks for any game object in the scene with the specified name, so it’s likely always returning the same object. If you want to find a specific game object or component within a specific game object or game object hierarchy though, there are several ways to do that. (For more info, take a look at Transform.Find() and at the various GameObject member functions.)