How do I control the Pitch, Roll and Yaw of a character with HMD?

Hi All,

I am working on trying to get my Oculus Rift to control a character.
Basically what I want it to do is:

  1. If I tilt my head downwards then this would control the characters Pitch.
  2. If I tilt my head to the side then this would control the characters Roll.
  3. If I turn my head to the side then this would control the characters Yaw.

The only 2 inputs from the game-pad controller will be acceleration and braking via the Left and Right trigger buttons.

Any help will be much appreciated.

Hi Daft_Fader,

are you planning on using Blueprints or C++?

If using Blueprints you can get the HMDs Orientation:

Use that Rotator to your liking and feed it into your SetRotation function of your character.

In case that doesn’t work you should also be able to get the rotation from simply getting the rotation of your Camera, if it is locked to HMD, which it is by default.

EDIT: Yaw/Pitch and Roll of the GetOrientationAndPosition Function are already equal to what you’d like to achieve, so I removed the part about splitting it.

Hi Chownas,

Thanks for the quick response.

I am quite new to Unreal so have very little knowledge of Blueprints, but I do want to do this with Blueprints.

Is there a way that this can be implemented into the Flying Template in UE 4.13?

Hi Daft_Fader,

I just had a quick look into the Flying Template and it seems to be pretty easy: Just feed the “Current yaw speed”, “Current pitch speed” and “Current roll speed” variables with the input I mentioned above.