Expand the function you use and confirm you use it correctly:
Searches for a GameObject by name.
- Only active GameObjects can be found.
- Names are case-sensitive.
- If your path starts with a
/ then the path must begin at the root of the scene.
- Assignment must occur before access. Often you would use
Awake to get, and Start to use.
Searches for children by name.
- Only direct children are returned unless a path is provided.
- Names are case-sensitive.
- If a path is provided, the path should look like:
Child/Descendant/Etc.
- Search the scene for all instances of the caller and check all results (
t:ExampleComponent for example).
- Assignment must occur before access. Often you would use
Awake to get, and Start to use.
- Check the console for a
UnityException. FindWithTag will throw an exception when used with a tag that does not exist.
- Only active GameObjects can be found.
- Assignment must occur before access. Often you would use
Awake to get, and Start to use.

Double-check the assignment is actually executed. Your code may never called because of an incorrect setup like a misspelt method name.
Find is an expensive method, see alternatives.