HTC Vive How To Control Character Movement Speed

I went through this documentation from Epic to set up the VR_Pawn in UE4 using the HTC Vive. Everything is working as expected.

I would like to play around with changing the movement speed of my pawn. Basically as I move in the real world I want to travel at a further rate in the virtual world. I was hoping to try this out with using a movement speed, but because you have to create your own pawn class there doesn’t seem to be any way to get to the movement speed.

Does anyone know how the vive applies motion to the virtual camera in UE4?

Thanks in advance,

:slight_smile:

I’m looking for quite the same thing. I need to know the speed of the player. Did you find any infos about this ?

I have not discovered this yet. I have also noticed that the VIVE doesn’t allow you to step up on rising platforms the same way that the Oculus does as well. Part of me wonders of the VIVE is locked down in some way to always maintain the 0, 0 at the origin of the room scale space. If you teleport you move that whole volume to a new location, but if you want to play with the speed in that volume I am still not clear on how to make this happen!

For now I’m just calculating the speed by myself. I first save the current position of the camera, then compare it with the new position 100ms later so I can approximate the player speed. If you want for example making your player moving faster, I think you have to play with the room scale. For example if you want your player to be 2X faster in the virtual world than in the real world, scale your virtual world by 0.5 (it will also scale the Z though…)

Can you give a screen shot? I am trying to do the same with the motion controllers. The velocity vector yields nothing. While the Get World transform on the motion controllers work. But I am not sure how to store the time for every tick.

  1. Just create a timer (float variable) and reset it to 0
  2. Save the current position of your MotionController into another variable.
  3. Increment the timer using DeltaTime in the Tick event.
  4. When it’s over 100 ms, get the new MotionController position. Substract it with the previously saved one and calculate the lenght of the result vector :). This is your velocity over 100 ms
  5. Restart from 1… etc etc ^^