Search Unity

VR Touch keeping hands rendered to a position while rotating an object.

Discussion in 'Scripting' started by Qbasic8, Jan 27, 2018.

  1. Qbasic8

    Qbasic8

    Joined:
    May 22, 2014
    Posts:
    16
    I am trying to rotate a heavy machine gun in VR using Oculus Touch. I am able to grab a hold of the gun handle
    and rotate it around the guns pivot point (which lines up with a tripod). This feels realistic, but as you are rotating
    the weapon your hands are able to move away from the handles which breaks realism.

    How do I keep the hands lock around the weapon that is pivoting on the weapons local pivot? Pistols, etc.. are not an issue because you can just parent them to the hand anchors point so they pivot with the hand. Using a fixed weapon system it is almost needs to be done in reverse.

    So in a nutshell I want when the hand is grabbed around the handles, the hands remain on the handles regardless of the rotation of the weapon. Any thoughts as to how to accomplish this? I could only come up with altering the original OVR scripts which feels like to much of a hack.

    I am using the regular OVR, OVR Avatar sdk assets, OVRCameraRig.
     
  2. Cuddl3s

    Cuddl3s

    Joined:
    Jan 25, 2018
    Posts:
    1
    Hey, I was wondering if you were able to find a solution to this, as I pretty much have the same use case and have also been struggling to get this to work..
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    We parent the hand model to the item always, fixed objects in the world or loose items the same. Here you can see it in action



    At the end of the video we have a fixed item in the world (a door)

     
  4. Albino_Burrito

    Albino_Burrito

    Joined:
    Jun 13, 2018
    Posts:
    4
    How did you achieve the hands stuck to the door