Using Unity 2023.1.9f1
I’m running into this weird problem where Unity is throwing ArgumentNullException: Value. The Game runs with no errors if I remove [SerializedField] Ammo ammoSlot;. Strangely enough the game runs fine after I unpause.
Here are some troubleshooting steps I’ve done:
• Remove [SerializedField] Ammo ammoSlot; (This removes error message)
• Reassign Player game object to Ammo Slot.
• Assigned ammoSlot = FindAnyObjectByType(); in Awake and Start methods along with Debug.Logs to double check.
• Debug.Logged void Shoot() and it works too.
• Added ammoSlot != null in if(ammoSlot.GetCurrentAmmo() >0) loop.
Since the game runs okay after I unpause, I’ll have to circle back because I really have no clue what’s going on here.