So I finished the course, and when I start my game in the editor, it throws a Null Reference Exception for the AttachWeapon function.
The game loads with just a “default weapon” but I’m unsure where the actual issue is. Here’s my error
NullReferenceException: Object reference not set to an instance of an object
Sanctuary.Harry.Combat.Fight.AttachWeapon (Sanctuary.Harry.Combat.WeaponConfig weapon) (at Assets/Harry/Scripts/Combat/Fight.cs:157)
Sanctuary.Harry.Combat.Fight.EquipWeapon (Sanctuary.Harry.Combat.WeaponConfig weapon) (at Assets/Harry/Scripts/Combat/Fight.cs:144)
Sanctuary.Harry.Combat.Fight.RestoreState (System.Object state) (at Assets/Harry/Scripts/Combat/Fight.cs:169)
GameDevTV.Saving.SaveableEntity.RestoreState (System.Object state) (at Assets/Harry/Scripts/Saving/SaveableEntity.cs:64)
GameDevTV.Saving.SavingSystem.RestoreState (System.Collections.Generic.Dictionary`2[TKey,TValue] state) (at Assets/Harry/Scripts/Saving/SavingSystem.cs:106)
GameDevTV.Saving.SavingSystem+<LoadLastScene>d__0.MoveNext () (at Assets/Harry/Scripts/Saving/SavingSystem.cs:34)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <ab7de6937a4448b0a6ccd59e9820599a>:0)
Now everything works, but it isn’t populating the default weapon into my inventory slot (I’m 90% sure it’s because there’s nothing in the equipment slot for the weapon)