I want the player to press the 'equip next' button to switch each hand's weapon in VR.

I want the player to press the 'equip next' button to switch each hand's weapon in VR. Because I will don't use hold and drop of item abilities in VR I need item set Manager and inventory.
I tried the 'equip next' ability and it didn't work, then it didn't have a parameter of slot ID.
Can I use item set in VR? Have you got any ideas? Thank you very much.
 

Attachments

  • pic1.png
    pic1.png
    28.6 KB · Views: 6
  • pic2.png
    pic2.png
    42.9 KB · Views: 5
  • pic3.png
    pic3.png
    19.8 KB · Views: 3

Justin

Administrator
Staff member
It is possible to use the ItemSetManager and not the Hold/Drop abilities in VR but it takes some extra setup. You'll need to remove all of the VR Item Abilities and use the standard set of EquipUnequip, Equip Next, etc. In the next version of the VR add-on I'll add an option to the editor that lets you specify if you want to use the Hold/Drop abilities or the Item Set Manager.
 
Thank you it's now switched. but I want the left hand to switch the left gun, the right hand to switch the right gun, And they don't influence each other, then The Equip Next ability has no slot ID attribute, How can I control it? If to add a new items Categories Then these two items are repeated in item types.
 

Justin

Administrator
Staff member
For that you will need to use the two categories, along with two EquipUnequips, EquipNext, etc. Having repeated Item Types is no problem.
 
:) Thank you It can switch guns normally Now, When switching, the gun will rotate from the initial position to the correct position. The animation of the hand is correct, but why does the gun rotate back? the weapon has no animator component.
 

Attachments

  • Video_2020-05-12_152653.gif
    Video_2020-05-12_152653.gif
    78.7 KB · Views: 6
  • item.png
    item.png
    50.4 KB · Views: 7
  • shooter weapon.png
    shooter weapon.png
    57.1 KB · Views: 4
Last edited:

Justin

Administrator
Staff member
The rotation of the first person items are specified within the FirstPersonPerspectiveItem component - I would try looking there.
 
Because to configure weapons I changed position offset and rotation offset, And the rest is unchanged in FirstPersonPerspectiveItem component.

 

Attachments

  • default.png
    default.png
    83.6 KB · Views: 1
  • firstPersonPerspectieItem.png
    firstPersonPerspectieItem.png
    74.1 KB · Views: 1

Justin

Administrator
Staff member
If you deselect VR Hand Parent does it work better?

If it doesn't can you output the localPosition values of the pivot/object transform within FirstPersonPerspectiveItem.ApplyMovement to see what is causing the change?
 
When I deselect VR Hand Parent, The shooter direction is wrong:unsure:, then it is right that the gun does not rotate.
When select VRhand parent I found two ways. Now it can work normally:).
(1) In FirstPersonPerspectiveItem script, to modify true of m_UseSpringExitOffset to false in StartEquip and StartUnequip.
(2) In FirstPersonPerspectiveItem Inspector, value of position Offset equal to value of position exit offset and value of rotation Offset equal to value of rotation exit offset.
 

Attachments

  • FirstPersonPerspectiveItem.png
    FirstPersonPerspectiveItem.png
    28.1 KB · Views: 3
  • Inspector.png
    Inspector.png
    61.4 KB · Views: 3

MikeSimpson

New member
It is possible to use the ItemSetManager and not the Hold/Drop abilities in VR but it takes some extra setup. You'll need to remove all of the VR Item Abilities and use the standard set of EquipUnequip, Equip Next, etc. In the next version of the VR add-on I'll add an option to the editor that lets you specify if you want to use the Hold/Drop abilities or the Item Set Manager.
Did you add this option in the latest update? If so can you tell me where the option is, I couldn't find it.
 

Justin

Administrator
Staff member
No, I haven't added that option yet. Thanks for the reminder. You can still manually set it up with the steps above.
 
Top