Buying an Equippable Item Auto Equips

polonel

Member
When I purchase an equippable item, it auto equips to the player. (Using UCC integration) Is this the default/design behavior? If so is there a way to disable it?
 
Yes the default behaviour is to equip the item that was just added in the inventory.
You can change that on the Equip Unequip item ability of the UCC locomotion script:
1603699793571.png
Change Auto Equip Mixed by "Nothing". Then you'll can equip items manuall/through code instead of automatically on pickup
 
Thanks for the info. This did what I was looking for.

However, after making this change I noticed that if I load a save inventory where It was saved with the item as equipped, it did not visually equip the weapon and make it usable. This occurs when the Auto Equip was set to "Nothing". The weapon was showing on the player inventory as equipped.
 
Ah yes I didn't think about that. That sounds like a bug on the saver component I'll see what I can do to fix this in the next update.
 
Hi @Sangemdoko , I found that Auto Equip the item that was just added to inventory won't trigger the
IntegrationEventNames.c_GameObject_OnItemActionEquipUnequip_ItemInfo_Bool event. In my case, this event only triggered by equip/unequip action menu.
I'm using UCC+UIS, if I want to listen the items equip/unequip event(including drop equipped item), which events should I register?
 
Yes that event is only called by the Item Action to equip the item. It's actually the event that triggers the equip, so that event is not necessarily called after the equip happened.

For that you can use the UCC events:
OnInventoryEquipItem
and
OnInventoryUnequipItem
There are more UCC events, you can find them here:

You can find the UIS Item from a UCC item using the Inventory Bridge. You can find code examples at the very bottom of this page:

Also note that I am working on a big UCC+UIS update and some of the events for the integration might becomes obsolete once the update comes out in a few weeks. I'll make sure to mention that in detail in the release notes
 
Top