Wrong Transform?

This is usually what happens with way too much GetComponent and FindWithTag type use.

In general, DO NOT USE Find-like or GetComponent/AddComponent-like methods unless there truly is no other way, eg, dynamic runtime discovery of arbitrary objects. These mechanisms are for extremely-advanced use ONLY.
If something is built into your scene or prefab, make a script and drag the reference(s) in. That will let you experience the highest rate of The Unity Way™ success of accessing things in your game.

“Stop playing ‘Where’s GameWaldo’ and drag it in already!”

Here’s more interesting ways to connect things together:

More information: Regarding GameObject.Find · UnityTipsRedux

More information: Why cant i find the other objects?

Remember the first rule of GameObject.Find():

Do not use GameObject.Find();

1 Like