Unable to Move After Grenade Explodes

Tester115

Member
I seem to be encountering an issue where the player is unable to move the character or control the camera after a thrown grenade explodes.

Here is a link to a video of the issue:


I also get the below error in the console window:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Inventory.Inventory.GetActiveItemInternal (System.Int32 slotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/Inventory.cs:146)
Opsive.UltimateCharacterController.Inventory.InventoryBase.GetActiveItem (System.Int32 slotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:298)
RegisterHit.OnImpact (System.Single amount, UnityEngine.Vector3 position, UnityEngine.Vector3 forceDirection, UnityEngine.GameObject attacker, System.Object attackerObject, UnityEngine.Collider hitCollider) (at Assets/Opsive/UltimateCharacterController/Scripts/RegisterHit.cs:181)
Opsive.Shared.Events.InvokableAction`6[T1,T2,T3,T4,T5,T6].Invoke (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) (at <fa7bae0bde914e57874fdb6999909243>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2,T3,T4,T5,T6] (System.Object obj, System.String eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) (at <fa7bae0bde914e57874fdb6999909243>:0)
Opsive.UltimateCharacterController.Objects.Explosion.Explode (System.Single damageAmount, System.Single impactForce, System.Int32 impactForceFrames, UnityEngine.GameObject originator) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/Explosion.cs:189)
 
Last edited:
I believe I have found the issue. The throwing animations were missing the OnAnimatorItemUseComplete animation event for some reason.

Edit: The player can now move after throwing a grenade but is now unable to move when the character runs out of grenades and auto switches to a new weapon.
 
Last edited:
You should check the animator again. There might be an issue with the unequip of the grenade. Can you toggle weapons without throwing the grenade?
 
Based off of that error you have a custom script (RegisterHit) causing the exception. You should fix that first and then see.

Also, I do not recommend saving your custom scripts in the UCC folder as it makes updating harder.
 
Top