Equip left hand item does not work at all

kendogar

New member
Hey there,

I'm all out of ideas. I want to create an item and equip it in the characters left hand (slot 1). I'm fine equipping right hand (slot 0) and animating that, but when I try to change the slot id to "Slot 1", it does not longer work.

The item gets spawned under the correct item parent in both the first person arms and the third person character rig, but there is no equip animation event being fired and the arms do not activate.

I'm all out of ideas, no idea what I'm doing wrong. Please help me here.
 
So I realize that is not a lot of information, so I took some screenshots.
Here is the item prefab that gets added through loot or loadout:

item_prefab.png

Then there is the item set manager on the character. Seeds is a decendant of "equippable":

item_set_manager.png

The item gets equipped under the slot of both the arms and the third person character, but remains inactive:

equipped_inactive.png

I did not yet add any dedicated animator clips for the situation but thought I will use the default sword one for testing purposes while adding the necessary transition for the slot1 item, but there is no event being fired for the equip/unequip action anyway. Also the "StartEquip" function in Item.cs does not even get called when equipping this item. I must have missed something important here...
 
It looks like you are using the inventory system integration? I am moving this thread so Santiago can take a look.
 
Just to clear things up, are you trying to equip your item in both left and right hands?
If you only wish to equip this item in the left hand and never the right you should use a more specific ItemCategory in your ItemSet rules. Right now you have a rule to add any Equippable as a right hand item and another rule to set any Equippable as a left hand item. And this is most likely causing issues if you haven't defined your Item Prefabs as being able to equip on both.

For example, these are some ItemSet Rules from the project I am working on. I only want to equip "Bow" in the left hand, so I make sure to specifically define it so.
1627368066931.png

Now if you wish to equip that item in both/either hand, I would recommend you have a look at the Multi Wield Gun from the demo scene and demo database. To allow you to equip the items in both hand you must define two Item prefabs, on for each hand using an array of prefabs. Then Slot ID in the Prefab must match the index in the array for it to work correctly.
1627368202124.png

Hopefully once you've set it up correctly the animation will work, if not do let us know.
 
Hello Santiago,

yes I wanted the item to be only equippable in the left hand and specifying the rules more precisely did solve the issue, here is what I did now:

1627393284511.png

Honestly, I do not know why I had to do it like this and neither do I understand why I have these granularities in the Set rules.
Equippable is the parent of both Tool and Seeds and I believe after the tutorial I understood that the rules get checked from top to bottom.

So I thought if I have a tool and specify Slot 0 in the item, it will check against the rules and match the first rule, as that allowed equippables to be in Slot 0 while nothing is in Slot 1.
Following on that I thought that by adding a second rule allowing an equippable to Slot 1 while Slot 0 is empty, upon equipping an item with Slot 1 specified it will check against the first rule, fail, but match with the second rule and equip the item.

Kind of hard to explain what I am thinking... But anyway! I'm just glad the above works and produces the expected result, altough I wish I would understand better why my previous solution did not work the way I expected.

Kind regards
 
I get what you mean... I guess my rules aren't smart enough to detect that the item prefab is defined to be in a specific slot. So it creates an Item Set for both right and left hand, then it tries to add the item in both slots in the two item sets.

I will look in the code and see if I can change the default rules to check the Slot ID within the prefab it plans to spawn. To be fair it could be the underway around too, that it changes the SlotID of the Item when it is spawned to match the ids defined in the rules.
I'll need to investigate to see which one makes more sense for the next update
 
Yeah you are right of course, it could very well be the other way around for other users.

Anyway! I'm glad for the amount of work taken of my shoulder by using your Asset(s) so, thank you for your support!
 
Top