Equip Unequip Weapon in UCC from Hotbar

lordzeon

New member
Hi, im a bit lost with the UCC + UIS integration for my hotbar. Im trying to do a hotbar like survival games, where it works like a extension of the inventory using 1 to 9 to equip / unequip each slot, you can drag to/from there into inventory. I followed the suggestion of the demos scene of doing a equipment slot, i did that and it is working ok, but i don't fully understand the integration for equip/unequip.

UCC character have item ability Equip/Unequip:
1715627550199.png
but there isn't any mention there of slots or collection, i don't know how those inputs are interpreted or what action are they doing, by default i understand the item set rules are ccreated based on the loadout and Equip/Unequip Ability use those combinations based on index?

so if i want to use my Hotbar made of 9 equippable Equipment Slots, this setup should do that?
1715628117330.png

This currently doesn't do anything, so im sure im missing something, i can correctly drop the weapons on the hotbar, but hiting the numbers don't equip the weapons. I tried disabling the Equip/Unequip item ability from atlas but its the same, im missing something or im doing it completely wrong?

EDIT: the screen show index 0 for all the inputs but i set that after screen with the same result
 
Last edited:
You are correct, the Equip/unequip ItemAbility uses the ItemSet index to equip items.

In your case you probably don't need them. instead you can use the Hotbar input directly for equip/unequip item for different indexes.



By default the CharacterEquipUnequipItemAction will move the item to the main item collection when unequipped. Make sure that's not the case for you if you plan on using an equipment hotbar. I would recommend duplicating the EquipItemAction (Item Action Set) so you have a different one for your EquipmentHotbar and for your InventoryGrid.

To preven the item from moving to another collection on unequip select that option:aq8RmuzqwS.png


Apart from that everything looks good to me, I wonder why it is not working. Maybe try setting this value to 0 since you only have Equip/Unequip action:
clCyLXqNBp.png



If you check out the integration demo scene you'll see that we use a ItemHotbar component for the hotbar, with this component for handling input and it works as expected.

Unity_tfn6Bcv120.png


I don't see why it wouldn't work with an equipmentHotbar when the logic is basicly the same.

Perhaps try adding a console.log in the ItemActionHandler to see if you are actually getting the input and see at what point it stops
 
Hi thanks for answering.

I did the changes you suggested and for Item Rules i removed all and created a single Equipable item rule. With this it works correctly for equip the item in hotbar but i have some doubts now:

1) the item doesn't unequip when i hit again the same key
2) because it is equipment slot collection, all the items there show like this:
1715800120236.png
there is any way to make the background appear only for the equiped item/s ? or the selection box at least (which only respond to mouse now)

3) my intention was to use item rules to allow convinations in the hotbar, so pistols could use dual wielding, or use a shield in one hand and pistol in the other always using the hotbar, so 2 items could be hightlighted, if user is equiping 2 hands and change to a 2 hands weapon, the others are deselected... is this possible out of the box?


edit:
4) also, if i move items from one slot to another in the hotbar, the slot key still access the old one. i can confirm that changing the item set rules was the reason why its working. atlas item ability is using the input, slot container action handler is not working at all
 
Last edited:
1)
Perhaps it's related to that bug that someone else reported:

2)
Check your ItemView prefab that you are using in your hotbar. There should be a CharacterEquipSlectionView component (or something with a similar name, I don't have the project open right now). Use that instead of default EquipSelectionView. Perhaps make a duplicate before making changes in case you are using that ItemViewprefab somewhere else too

The difference is that the character one shows the "equipped" background only when it is "Active" equipped on the character, not "Soft" Equipped.
I hope that makes sense

3)
I'm afraid that is not possible out of the box. You will need to code that yourself. You probably won't be able to use ItemViews for that, as only one item can be set per ItemView. So dual pistols can't really be shown in a single icon.

In your case you have two unique pistols, each able to equip independently. You could restrict it with an ItemSetRule to only allow dual pistol and not single pistol, but then you still have the issue of having two items, both in the Inventory and the hotbar.

I'm not sure how you would go about this, other than making something custom or defining dual pistols as a single item.

4)
That's really weird to me, I'll make note of it and test it out myself soon.
Were you able to replicate this in the demo scene or is it only happening in your own scene?
 
1) don't look the same, my categories are mutable and unique or abstract, i only changed the names to distinguish them from the defaults.
2) this worked Perfectly
3) i don't mean to have a unique slot for 2 pistols, but being able to equip 1 or 2 weapons, for example 1 and 2 have pistols, pressing 1 equip 1 pistol, pressing 2 equip the second pistol, pressing 1 or 2 to unequip go back to single pistol or any combination in the item set rules.
4) i did a new test, i set item equip/unequip ability in UCC to Start Type Automatic, in the hotbar, i made a simple input event like this:
1715899668733.png
and this work, so it looks like the problem is the Item View Slot Container Action Handler not reigstering the input for some reason?
1715899727906.png
To make this work i made a hotbar and used Item Hotbar Handler replacing every field with the ones i already have, this worked, can you confirm that item Hotbar Handler and Item View Slot Container Action Handler work the same for the input?

5) Also... sorry for unrelated topics, i edited the weapons of the example, everything work as espected except for the bow, ammo and clip is registering ok, i can reload an arrow... but it doesn't shoot, in the sample it works, i followed the UCC + UIS integration video tutorial and did exactlly the same for the rifle and pistols, but for bow it doesn't work, there is anything else to check?
 
Last edited:
Back
Top