Runtime Pickup Error

Rabassa

Member
Hello,

I followed the video tutorial for creating a runtime pickup item but I get this error when my player tries to pick up the item:

Error: The AnimatorAudioState is null. Select the item Rich_Rifle(Clone) within the inspector to serialize.
UnityEngine.Debug:LogError(Object)
Opsive.UltimateCharacterController.Items.AnimatorAudioStates.AnimatorAudioStateSet:DeserializeAnimatorAudioStateSelector(Item, UltimateCharacterLocomotion) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/AnimatorAudioStates/AnimatorAudioStateSet.cs:129)
Opsive.UltimateCharacterController.Items.Actions.UsableItem:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/UsableItem.cs:127)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:344)
UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion, Transform)
Opsive.UltimateCharacterController.Game.ObjectPool:InstantiateInternal(GameObject, Vector3, Quaternion, Transform) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/ObjectPool.cs:150)
Opsive.UltimateCharacterController.Game.ObjectPool:Instantiate(GameObject, Vector3, Quaternion, Transform) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/ObjectPool.cs:134)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:DoItemPickup(GameObject, InventoryBase, Int32, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:177)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:TryItemPickup(GameObject, InventoryBase, Int32) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:127)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:TriggerEnter(GameObject, Int32) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:115)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:TriggerEnter(GameObject) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:93)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ObjectPickup:OnTriggerEnter(Collider) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ObjectPickup.cs:164)



any suggestions?
Thanks
 
What version are you running? This looks related to this post:

 
That error should have been fixed in that version. Can you follow this post so I can reproduce it?

Hello,

I just updated UCC to version 2.1.8 and still getting the error.

Character Controller: UCC First & Third (toggling in game)
Unity: 2018.2.21f1 (running on a Mac but build for Windows)
Bug: Occurs when character comes in contact with Pickup Item

Error:

Error: The AnimatorAudioState is null. Select the item Rich_rifle 2(Clone) within the inspector to serialize.
UnityEngine.Debug:LogError(Object)
Opsive.UltimateCharacterController.Items.AnimatorAudioStates.AnimatorAudioStateSet:DeserializeAnimatorAudioStateSelector(Item, UltimateCharacterLocomotion) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/AnimatorAudioStates/AnimatorAudioStateSet.cs:129)
Opsive.UltimateCharacterController.Items.Actions.UsableItem:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/UsableItem.cs:127)
Opsive.UltimateCharacterController.Items.Actions.ShootableWeapon:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableWeapon.cs:344)
UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion, Transform)
Opsive.UltimateCharacterController.Game.ObjectPool:InstantiateInternal(GameObject, Vector3, Quaternion, Transform) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/ObjectPool.cs:150)
Opsive.UltimateCharacterController.Game.ObjectPool:Instantiate(GameObject, Vector3, Quaternion, Transform) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/ObjectPool.cs:134)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:DoItemPickup(GameObject, InventoryBase, Int32, Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:177)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:TryItemPickup(GameObject, InventoryBase, Int32) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:127)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:TriggerEnter(GameObject, Int32) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:115)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup:TriggerEnter(GameObject) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:93)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ObjectPickup:OnTriggerEnter(Collider) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ObjectPickup.cs:164)



Here are screen shots of my setup:

Screen Shot 2019-09-16 at 8.56.36 AM.png


Screen Shot 2019-09-16 at 8.56.47 AM.png


Screen Shot 2019-09-16 at 9.00.44 AM.png
 
Okay - I was able to avoid the error by adding an Item Pick audio clip to the item. My character picks up the item but won't equip it. I copied Nolan from the demo scene and put him in my scene. Nolan is able to pick up and equip the item... So my character must be set up wrong, but I can't figure out where. Any suggestions?

thanks,rich
 
Glad you are able to get around it.

I am not able to reproduce it with that setup. Can you list step by step how you are able to reproduce that error? If you want to record a video of it occurring after you import UCC that would also work.
 
Glad you are able to get around it.

I am not able to reproduce it with that setup. Can you list step by step how you are able to reproduce that error? If you want to record a video of it occurring after you import UCC that would also work.



Good idea - Right now I'm just using Nolan from the Demo scene - he's all set up the way I need :)
-rich
 
Top