Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to slow down XR controller velocity?

Discussion in 'XR Interaction Toolkit and Input' started by MichelleSchr, May 1, 2023.

  1. MichelleSchr

    MichelleSchr

    Joined:
    Apr 3, 2023
    Posts:
    1
    Hi there!

    I want to slow down the (perceived) velocity of my XR controller when entering a specific area in the VR scene with my hand. Maybe it doesn't even necessarily have to be slowing down, but the essence is that if I move my hand 5cm to the right in real life, I want it to move only 3cm for example in VR.

    I have managed to get my controller velocity InputDevice.TryGetFeatureValue, but don't know how to adjust it. I also don't know if adding a force is possible, since I currently have no rigid bodies on my controller or hands game objects, and adding one seems to break my current functionality.

    Does anyone know how to solve this problem?
     
  2. FileThirteen

    FileThirteen

    Joined:
    Oct 23, 2012
    Posts:
    40
    I think the simplest solution to something like this would be to create like proxy hand objects that follow your hands, using physics. You can create either a ragdoll/motor system to make the hand follow your hands or you can come up with your own "springs" by calculating the desired movement, from that the desired velocity, from that desired acceleration, and from that desired force/torque. Then you can make those affected by whatever forces you want. Then hide the real XR hands and treat your new physics ones as the real ones. The downside here is you probably will lose out on the actual accuracy of the tracking due to any imperfections in physics and such. You could probably put any interactors on your proxy hands and swap the controls over to them. Then only have this system active near the parts you want the slow down stuff.