Unity-Technologies/EndlessRunnerSampleGame

Power-ups display errors, don't clear during/between runs

Jacekpapapolski opened this issue · 1 comments

Upon collecting a pickup you receive an error. When the pickup runs out you receive an error.
The pickup UI never leaves the screen so as you collect more powerups during your run the bottom left of your screen continously fills up with (now empty) powerup icons

Lastly when you finally die and then start a new run all previous powerup icons will be displayed in the bottom left from the previous run

The errors are:

NullReferenceException: Object reference not set to an instance of an object
Consumable+d__19.MoveNext () (at Assets/Scripts/Consumable/Consumable.cs:69)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[UnityEngine.GameObject], result='', status='Failed': Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=8cede34fb26a722408198e0d27628ae9
UnityEngine.AddressableAssets.AssetReference:InstantiateAsync(Transform, Boolean)
d__19:MoveNext() (at Assets/Scripts/Consumable/Consumable.cs:67)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
CharacterInputController:UseConsumable(Consumable) (at Assets/Scripts/Characters/CharacterInputController.cs:425)
CharacterCollider:OnTriggerEnter(Collider) (at Assets/Scripts/Characters/CharacterCollider.cs:181)

Fixed in a4c1c1f - Closing!