Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Charlie10's avatar
Charlie10
Honored Guest
10 years ago

Making Player Movement a Function of Head Set Position

I am working in Unity, trying to make a game where the player moves solely based on the movement of the head set. I've gotten the player to move at a constant speed in the direction the head set is facing by using the rotation of the 'CenterEyeAnchor' as compared to the initial rotation of the 'CenterEyeAnchor'.

Now I would like the speed to depend on how far the person is moving their head (if they are leaning a lot I want the speed to be fast while if they don't move their head the speed should be 0). I've tried using the localPosition of 'CenterEyeAnchor' but it isn't behaving as I'd expect. I want to make the speed a function of the magnitude of the difference between the original head position and the current head position which I thought would just be the difference between the starting 'CenterEyeAnchor' localPosition and the current 'CenterEyeAnchor' localPosition. However, when I move the head set around and track this magnitude I don't understand what it is measuring.

Is the problem with the implementation of my current approach or am I missing some other way of doing this?

Thank you!
Replies have been turned off for this discussion