Empty Slot

matmalm

Member
Hi. I'm using the last version of UFPS and UIS, in Unity 6.000.40 URP.

My aim is so my character start empty handed (empty slot I guess) at the start of the game (along with the default items equipped), and also have an empty slot when the character is switching items.

The current setup/settings I have:
- The player have 2 slots:
· Slot0 = any kind of item, except an specific item (call it Caselink).
· Slot1 = only specific item (Caselink).
- For Slot0 the player can equip them with Next/Previous item.
- For Slot1 the player can equip it with a toggle.

Therefore, I have 2 Item Categories, one for Slot0 and another one for Slot1.
Also, so these items don't overlap when the player is equipping them (Slot0 and Slot1 equip at the same time), I have set a State for disabling the ItemSetPreset.
It looks like this:

itemsetmanager.png

The rules are applied for every ItemSetRules of Equippable category (yes, bad spelling), except for the EmptyItemSetRule:
Rule.png


The current approach for what I'm aiming and that works right now, is adding an empty rule for both Equippable and CaseLink Category as shows in the images.
It works like this but it gives me 2 issues:

- When unequipping an item an encountering the Empty Item, it unequips the item but the hand animation stays for a bit longer.
- It's difficult to track if the player has an item equipped. For example: I have a custom "Drop" in which the player can activate a "placement mode" and place the item in a specific location. Therefore, I can deactivate the "placement mode" if the player change to another item, as there are built-in methods I can call, but it's more difficult to track when the player is on the empty item, as there was nothing I could find for a reference so the system is aware that the player has switched to another item.

I also would like to know if it's the right way to do it or should I do another approach.
Thanks!
 
At first glance it all looks good to me.

For the first issue, I'm not sure what could cause that.

For the second issue, I'm not sure I understance your needs. Do you need to find the soft equipped items? Or do you need to know when the ItemSet changes?
For the former you should be able to loop over the items in the equippable itemcollection or over the character items.
For the latter you should be able to know by listening to the character on equip event:
You can ctrl+F "Equip" to find all relevant events here
 
At first glance it all looks good to me.

For the first issue, I'm not sure what could cause that.

For the second issue, I'm not sure I understance your needs. Do you need to find the soft equipped items? Or do you need to know when the ItemSet changes?
For the former you should be able to loop over the items in the equippable itemcollection or over the character items.
For the latter you should be able to know by listening to the character on equip event:
You can ctrl+F "Equip" to find all relevant events here
Thanks, I could fix the second issue.
But not the first. To explain it better, this is what happens when the character switch or drop the item:
When switching to another item is fine, but when it switches to the empty one, the animation of the item is not synchronized with the removing of the item:

I have for both equip and unequip settings on the CharacterItem "Wait for animation event" unticked, and the duration set to 0.


Something else:

When the player has the CaseLink in hand and it picks up an item, the item is added to the inventory but it doesn't get in the hand of the player immediately when picking it up (the player can switch to it later). It might be because of the rules?
I don't mind too much that the item doesn't get in the hand of the character right away, but when that happens, the dropped/pickup item prefab instance in the scene gets disabled instead of destroyed.
 
Last edited:
Sorry completely missed your message last time.

> I have for both equip and unequip settings on the CharacterItem "Wait for animation event" unticked, and the duration set to 0.
Out of curiosity if you were to set a value above zero does it play the animation and unequip once the hand is off screen?

> When the player has the CaseLink in hand and it picks up an item, the item is added to the inventory but it doesn't get in the hand of the player immediately when picking it up (the player can switch to it later). It might be because of the rules?

I think this has less to do with the item rules and more with the pickup.
Is the pickup using the UIS components or the UCC components or the Integration components?
I believe that if you use the integration components you can choose to equip on pickup with an option on the pickup component

Another setting you can look into is if you are using an ItemSlotCollection in your UIS Inventory for your equippables. You there is boolean for choosing if added items have priority on existing equipped item. if so it automatically removes the current item and replaces it with the new one.


>I don't mind too much that the item doesn't get in the hand of the character right away, but when that happens, the dropped/pickup item prefab instance in the scene gets disabled instead of destroyed.
That's also something you should be able to control on the pickup prefab. Some have an option to disable or to destroy on pickup.

If you are unsure what pickup component you are using send me a screenshot and I can give you more specifics :)

I hope that helps
 
Out of curiosity if you were to set a value above zero does it play the animation and unequip once the hand is off screen?
I set it to 0.05 the equip and unequip and the hand is good, but I'd like to equip/unequip the item as fast as possible, almost simultaneously if it's possible...

I think this has less to do with the item rules and more with the pickup.
Is the pickup using the UIS components or the UCC components or the Integration components?
I believe that if you use the integration components you can choose to equip on pickup with an option on the pickup component

Another setting you can look into is if you are using an ItemSlotCollection in your UIS Inventory for your equippables. You there is boolean for choosing if added items have priority on existing equipped item. if so it automatically removes the current item and replaces it with the new one.
The pickup is using the UIS components (the integration), but the items are using the CharacterItem. Every object is set to equip on pickup, as it only happens with the "CaseLink" I guess is something else, but haven't been able to figure it out.

I'm using it with an Item Collection, is it necessary with an ItemSlotCollection?

That's also something you should be able to control on the pickup prefab. Some have an option to disable or to destroy on pickup.
I think that something is conflicting it with the equipping, as it equips it in the inventory but it doesn't get active immediately on the hand.

Almost the same behavior was happening when setting an inventory size capacity for the player to carry a max number of items, and after the inventory was full and the player was picking up an item, the pickup item wasn't getting equipped but it was also getting destroyed.
 
Back
Top