Download

Calculate Vive HMD Movement speed and direction

Hi All,

I am a bit new to Unreal and trying to build a multiplayer game using the ThirdPersonCharacter as my player (build a small multiplayer in the past without the Vive) .
I move the character in the world according to the Vive (camera) WorldLocation on every tick (set WorldLocation) and it seems to work (Is it the right way to do it?).
My problem start when I want to animate the movement of the character.
For this I would need the speed and direction of the movement which I am unable to calculate at the moment.

My thinking is to have a tick event (every 100 miliseconds, maybe less) which will compare the the previous WorldLocation and will calculate the speed.
I would also need to calculate the which direction of movment, but I don`t know where to start with this, I run some tests but couldn’t fully understand how it works.

can someone help here please?
I know that maybe I jump over my head here and it could be lack of basic knowledge but as I know myself its the best way for me to learn.

Thanks in advance,
Doron