Search Unity

Question XR RIG Movement Speed

Discussion in 'VR' started by Freakish, Jul 19, 2022.

  1. Freakish

    Freakish

    Joined:
    Jun 3, 2015
    Posts:
    81
    I've been trying for the most part of the day to determine the player movement speed with XR and Quest2. (PCVR).

    I can get a speed when using Locomotion, but I'm after the speed at which I the player walk around my physical space.

    I've tried comparing a bunch of transform positions, and also tried looking at various velocities from controllers and HMD, and even accessing the CharacterController velocity, but none of these are helping....

    I assume it would be something like the difference between MainCamera(HMD) local and worldspace, but cannot seem to get anything useful. (OldPos vs NewPos).

    Any ideas on how to determine a speed I'm walking around at?

    Thanks for any help/advice.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Compare the position of the camera in fixedupdate (or update if you take into account deltatime)