Download

Restricting angle view rotation using "use controller rotation yaw" issue

Hi,

I have been working on a little prototype of a first person body, mostly for VR games using the third person character as my base.

Currently the player is able to walk in the direction the player is looking and when they stop the player can look around without moving the body rotation, I have achieved this with “use controller rotation yaw” in my character blueprint.

The issue is that I want the player’s character to start rotating once they look a certain angle to the right or left, without this it is possible for the player to do a full 180/360 on their own character which looks terrible.

Video demonstrating problem:

Blueprint for character:

Movement_Input:
0593e03436ab271d4458300d05a7730eeeab622a.jpeg

Mouse_input:
9fd669f58f908de1f5db2dc5b6ed16dfaaaf58b7.jpeg

Thanks in advance.

Get the difference between the view yaw and body yaw.

If this value is greater/less then the max yaw, add/sutract this value from the body yaw.

After that, run the view yaw through a Clampangle function with the same +/- max yaw values.

Its what I do in C++.
Should work fine as a Blueprint too.

Thanks Kris, I had tried a few different ways before I posted however it didn’t turn out too good, I took your suggestions and used the yaw value comparison to drive whether the “use controller rotation yaw” is active or not.

I used the following setup to determine whether the angle is in range then perform a branch during the rotation.

Rotation_Check.jpg

The body does snap into position when the rotation is out of the range, but that’s not too different from the movement rotation either, I’ve haven’t yet found a way to smooth rotations out yet, but this is another small step forward.

Thankyou for your help.

Another suggestion for this had been posted elsewhere, where the LimitCamera is hooked up to an Event Tick with Clamp Yaw (55) and Clamp Pitch (35).

Thanks Wes, I’ll have a look at this when I’m back at my dev machine.

I’ll probably have to try this as well. Chilly, any reason you chose the third person example as your base rather than first person (animations and body)?

Also, do these controls work well for a non-oculus user?

The reason I used the third person body was that I required a full body for VR projects as the floating camera didn’t feel right, the body works well outside of the rift as well, it was just something to make the player feel like they have more of a physical presence while ingame.

Herp derp, never mind, I misread! Disregard this post.

Hi ,

i’m pretty sure that those who have start and answer to this post will not see that but i’ve been working on an aim offset and i’ve searched a few hour a way to clamp the control rotation between -90 to 90 for pitch and yaw … and The solution gived by Wes Bunn is totally working !

so yeah Thank you ! :slight_smile:

This its working