I’m trying to rotate the player’s character using Blueprints in a Blueprint driven FPS. The player’s character comprises of a capsule, camera and character movement components and I’m trying to implement a 180 quick turn on a single button / key press.
However no matter what I attempt to rotate, the player, the capsule, the camera, the rotation will not update. I’ve tried doing this by setting both the world and relative locaiton on all of these.
I can teleport the player fine but no matter what try, it’s not possible to change the yaw.
If I attempt to change the pitch or roll then the camera ends up sinking into the ground and vibrating.
Unfortuantely, using the Yaw Input is not accurate for this ation.
Is there any chance that setting the rotation on characters is broken?
An easy way to do this is to use the Add Controller Yaw Input node. If you look at the default MyCharacter Blueprint in the FPS template, you’ll see that the Mouse Input links to the same node. You can set up something very simple with a key press that links to that node, and give it a value of 360:
This can of course be elaborated on to make a smoother transition, but that’s the basic idea.
Hope that helps!
I want to blend over a period of time, around half a second.
The Add Controller Yaw input is done on a frame basis so any attempt to do that over half a second gives different results at different framerates and therefor not a viable option.
I need to know if the Set Rotation functions in this instance are broken or working as intended and if there is another way of achieving this result.
The Set Rotation nodes are referencing the Pawn rotation. The reason they don’t rotate your character directly is because the control rotation of the PlayerController is overriding the attempt to change the Pawn rotation. You can try doing an interp on the PlayerController with SetControlRotation. You could also use the AddControllerYawInput with a timestep modifying the Value.
I wanted to achieve something similar. However i couldn’t do it exactly the way i wanted due to a small issue regarding lerp functions. My “Characters” are receiving their input from from the Controller Blueprint.
Check out my post, it could give u more insight into the issue. I tried various ways of achieving this.
Keep in mind my camera does not rotate when the player rotates. I wanted only my player to rotate and not the camera so i couldn’t use yaw, pitch or roll otherwise it would affect my camera.
Hope it helps.
Hey, I’m not sure if this is what you are looking for. But this should be a simple blended animation over time.
Unfortuantely the ‘Set Actor Rotation’ doesn’t work in this case.
However ‘Set Controller Rotation’, as suggested above, works perfectly, rotating both the player and the collision capsule as required.
Thank you all for your help and suggestions.
You can try uncheck “Use Controller Rotation Yaw”
in Class Deafults of your Character.