Equip/Unequip ability called twice, Use ability problem with Animator

Szymon Z.

Member
Hello :)

I have 2 problems. We are currently working on our own Inventory System (we are building a Bridge between UCC Inventory and our Inventory). The system is simple. What we did so far is:
- We can pickup item and add it to our Bridge
- We are creating IItemIdentifier
- We are creating ItemSet in UCC
- We are moving Item from our Bridge do UCC.

Now we want to equip. So basically when i have my ItemSet prepared and configured i can just cal StartEquipUnequip(). And this part is working... almost :)
We are able to equip item and this is working okay, we have item in hand with correct renderer etc. But just after equip event, the Kinematic Object Manager is calling Update and calling Update one more time and there is null references... So this is first question why this can happen ? I think its something connected with Refresh Abilities but im not sure what exactly (event is done after my manually equip so...).

And another problem is even when im using build-in one system (without any modification) i can sucessfuly equip item (without errors, and without called twice) but... when im trying to use Animator Monitor is throwing error in this place:
1627059414503.png
m_ItemSlotID has only one field but this method is called twice (second time with slotID = 1) what caused problems => out of range. What can be the problem ?
 
We are able to equip item and this is working okay, we have item in hand with correct renderer etc. But just after equip event, the Kinematic Object Manager is calling Update and calling Update one more time and there is null references... So this is first question why this can happen ? I think its something connected with Refresh Abilities but im not sure what exactly (event is done after my manually equip so...).
What is the call stack for both of those cases? Have you tried comparing to the call stack within a fresh project so you can see if it's different?

m_ItemSlotID has only one field but this method is called twice (second time with slotID = 1) what caused problems => out of range. What can be the problem ?
m_ItemSlotID should be initialized to the number of slots that you have, so it should be initialized to 2 if you have two ItemSlot components. This is set within AnimatorMonitor.InitializeItemParameters. It gets the slot count from Inventory.SlotCount.
 
What is the call stack for both of those cases? Have you tried comparing to the call stack within a fresh project so you can see if it's different?
With calling Equip/Unequip manually first is called fine (by my script) but just after that is second call from KinematicObjectManager.cs (method Move => UpdateAbililites) and from this point is called second time
 
Found the issues. If someone will hit same problems:

In the Execution Order the Inventory component is initialized as -103 (in my case). If someone want to rewrite Inventory component to own implementation is necessary to add script to Execution Order and put it in same place as Inventory.cs
 
Top