Multiple GameObject in hierarchy

If I have multiple game objects named 'GameObject in the Hierarchy then how does the FIND function work if you had:

Opponentshoot.transform.parent = GameObject.Find("GameObject").transform;

Which GameObject did it find? The first one?
And would not it behoove the developer to rename the GameObjects at the hierarchy root to different names?

1 Answer

1

Use GameObject.FindWithTag.

The script will find the object by its tag instead of name.

Nope, it only looks at the tag so it would treat each one different.