How to turn camera in direction of thumbstick?

I want my first person character to instantly turn into the direction where my right thumbstick is headed (no animation). So I tried to create an player controller. I fiddled around for several hours and messed it all up. This was my last attempt:

(Ignore all that threshold stuff in there).

I basically want to point the camera to the direction of the right thumbstick (relative to the current view, of course):

Examples:

  • Stick right: Face right
  • Stick left: Face left
  • Stick down: Face backwards
  • Stick up: No reaction

At least this works now, but for some reason I have to multiplicate the YAW values with 2 before I can apply them (+180 seems to turn the character only 90° and not turning him around as you would expect). I couldn’t find the reason for that.

Unfortunately this works ONLY with LEFT, RIGHT and DOWN but not for in-between directions like (forward-right / 30°). The results here seem completely random for me.

Can anyone please push me into the right direction? I don’t have the feeling that I understood this all in the right way…

Hmmmm it looks like you only delivering him one axis for Yaw, where is Pitch?

Really, no one? Again? :frowning:

I tried it for another day with no success. It seems, that ADD CONTROLLER YAW INPUT acts really strange. When I try to rotate it at 45°, it rotates about the triple factor… Only 90, -90, 180 and -180 are working correct (when I multiplay them with 2, why ever).

So, is there any reliable documentation how these values are interpreted by the engine?

Hi ,

i am not affecting pitch. I just want to point the camera in the direction of my right thumstick as soon as it’s released.

My problem is, that the values are interpreted very strangely by ADD CONTROLLER YAW INPUT.

  • A value of 30 should rotate the camera 30° to the RIGHT (about 2:00 O’Clock)
  • 45 should rotate the camera 45° to the LEFT (about 22:30 O’Clock)
  • 135 should rotate to the RIGHT (about 5:00 O’Clock)

Ok, I found a solution for my self:

The problem is indeed ADD CONTROLLER YAW INPUT which handles the input values very strangely. I now use this monster here which works like expected:

http://s1.directupload.net/images/140905/k3iu5wjr.png

EDIT: Doesn’t work when in VR mode, SET CONTROL ROTATION is completely ignored then, ARGH!! :frowning:

Fiddled out an even more complicated method which works in both modes:

http://s14.directupload.net/images/140905/2ydlgusk.png