Sword and Shield

bento

New member
I can setup runtime pickup for sword and equipped on right hand. I try the same thing for shiled, and set Slot ID = 1 (left hand). I put on 2 different location for sword and shield. Pickup sword first or just go pickup shield, the shield always go to the right hand. How to make it equipped on left hand ?

Please give me steps here, since I watch youtube video, read documentation, observe demo. Still I don't get what I want. Maybe I miss something.

1609217228125.png
 
Have you created the relevant item sets in the character's Item Set Manager? E.g. an item set with sword in slot 0 and shield in slot 1. You'll need one item set for each unique combination.
 
Hi @Andrew

I set this on character Item Set Manager, it still the shield go to right hand.

1609249097439.png

These are the settings what I set on Runtime Shield and Runtime Shield Pickup prefab

1609249181925.png 1609249277229.png

For sword, it working normally on the right hand. After I grab sword, shield will replace it on the right hand. If I grab shield first, then sword will replace shield on the right hand too.

What I miss here ?
 
Does the ItemSlot component exist in the character's left hand with an ID of 1?

If it does, have you gotten the shield to work with a normal pickup instead of a runtime pickup? I would start with a normal pickup because you can then use the same settings as what the demo scene uses just to eliminate the chances of error.
 
I am actually struggling with the same issue. Creating a shield to directly equip in the left hand works fine, but when picking up a shield during runtime it is always equipped in the right hand. I created it more than once and I am sure the slot-id is set to 1 and there is an item slot object in the left hand with the correct id as well.

You can see on these screenshots that the character even thinks he has a shield in his left hand (see his arm position). Also when picking up a sword afterwards, BOTH items are suddenly in the right hand.

shield_issue.jpg

On these screenshots you can see that the items are both slotted in the right hand. The second image here are the item sets outside of runtime and the last one with both items equipped. As you can see, it correctly put the sword/shield item set as active (and did the same with only the shield set right before picking up the sword as well)item_sets.jpg

I can personally not find anything wrong with the shield pickup object either, it does have the shield in slot 1 too:

shield_pickup.jpg
 
Have you gotten it working as a non-runtime pickup?

If you want to debug why it is selecting the location that it is you can place a breakpoint within ThirdPersonPerspectiveItem.GetSpawnParent. In your case the left hand transform should be returned.
 
Shields created in the Item Manager and directly put into the left hand of a character during creation => no problems.
Shields created in the Item Manager without a chosen character and instead picked up during runtime via a pickup object created in the Object Manager => the issues referenced above occur.

The pickup objects used in my test cases during runtime were directly put into the scene, no scripts or anything.
 
Can you place a breakpoint within ThirdPersonPerspectiveItem.GetSpawnParent and see why it is selecting the right hand? What value do you have for the Third Person Perspective Item's Parent Humanoid Bone value?

1609331882779.png
 
What does the item prefab's Third Person Perspective Item component look like? (e.g. the parent humanoid bone) Also as Justin suggested, you should be able to log/breakpoint in ThirdPersonPerspectiveItem.GetSpawnParent and see what the value of `parent` is.
 
When checking the Shield Prefab created via the Item Manager it does indeed say "Right Hand" as "Parent Humanoid". Switching this to "Left Hand" does fix the issue when picking the shield up during runtime.

Personally I thought this part was already covered by making sure the Slot ID is correctly set to 1 everywhere but I guess that declaring left or right hand is a independent step to be made after creating the item, while it already is covered when equipping directly, because there you already choose which hand. I wasn't aware that this step has to be done afterwards for runtime pickup item as it wasn't mentioned in the videos, as far as I can remember.

Thanks for the clarification here! :)
 
Glad you got it. I don't remember the reasoning for having the separate parent field. First person doesn't have it. I guess I thought that it made it easy with humanoids.

There is no need for it as the slot ID makes up for it. I will remove that part.
 
Top