Head Mount Display Camera Turn (with Keyboard)
i wanted to implement a way to turn my Camera with the keys Q and E (+30 and -30 degrees).
I have 2 Problems. If i use the Blueprint without the -1 float component, the Camera turn 30 degrees (in the opposite direction) with the first Keypress and with the second Keypress it turns back to it's previous position. Because the set Base Orientation and Rotation Offset subtracts the value it gets from the base value. 0 - (-30) = 30 (that's why the opposite direction), but somehow the next value, will be 0 again, thats why it gets the previous position after a second input.
That's why i added the -1 component. It works as long as the Head Mount Display Yaw is 0, if it's not 0, the value will differ from 30 degrees. For Example if my HMD Yaw is -60 Degrees and i press Q, the camera turn to +90 Degrees, because of the -1 component.
Can someone help with this? I am completly desperate about this and have no idea how to solve it.
asked May 20 '15 at 02:46 PM in Blueprint Scripting
Ok I found it and I wasn't aware of this too, it's kind of undocumented 0o
In the PlayerController source you find this call resulting in this
So the PlayerContoller has a value called InputYawScale that ist default set to 2.5 in the BaseGame.ini
So we can either set it by hand like I did it in the Screenshot or you can do it in the DefaultGame.ini in your project's config folder:
answered May 22 '15 at 01:46 PM
Well I try to explain it in pseudo code with overexpressive variable names:
And for your tunr in the other direction:
Of course you can combine it like that:
If PositiveOrNegativeChangeValue can be higher than 360 or lower than -360 normalization could be done in while loops. Shown here in a more condesed way:
Optionally you can also turn your Pawn, instead of recallibrate the HMD. Maybe that makes more sense if the pawn can move also.
answered May 20 '15 at 03:20 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here