Quick answer: Unity GameObject.FindWithTag("Player") returning null even though a player prefab exists with that tag? Find inspects the active scene; prefab assets are not in scene.
Code in Awake calls FindWithTag(‘Player’) before the player has been instantiated; the find returns null and gameplay crashes.
Find Scope
FindWithTag (and Find, FindObjectOfType) searches active GameObjects in the loaded scene. Prefab assets, inactive objects, and additively-loaded scenes may not be searched.
Order of Spawn
If the player is instantiated later, Awake on other objects runs first. Defer the find to Start — runs after all Awakes — or use an event when the player spawns.
Inactive Objects
FindWithTag skips inactive GameObjects. Use Resources.FindObjectsOfTypeAll<T> for inactive search — expensive; reserve for setup-time.
Better: Direct References
Inject references in the inspector or via a service locator. FindByTag is a code smell for runtime dependency — brittle to scene changes.
Verifying
Tagged objects are found when expected. Errors / nulls don’t happen during normal scene flow.
“Find only sees active in-scene objects. Prefab assets and inactive are invisible.”
Build a small service-registry pattern — objects register themselves on Awake and consumers look them up. No more Find-by-Tag at runtime.