Rotate camera without affecting movement

I want to rotate the camera of the first person character without changing the direction that the character moves; this is to facilitate looking over your shoulder while running away from something. anything I have tried has either not rotated the camera, or rotated the whole character. Thank you for your help.

Hey @VintageClaymore! You should be able to use “SetLocalRotation” for this. What have you tried? There are a ton of ways to go about doing this so it’s best to know what you have already tried, then we can help get you where you’re going.

Let us know what you’ve already tried, give us examples, pictures, anything tangible you could share with us! :slight_smile:

Multiple ways to handle, but each depends on your perspective and camera setup.

If you’re in first person w/the camera attached to the head bone, then you can use IK and just rotate the head bone. Camera will follow.

First person and the camera is attached to a boom which is attached to a neck or head bone, then you use the cameras relative rotation. If you need to the head to rotate along with it, then also do the IK bone modify for the mesh.

1 Like

Heh, yeah, that makes sense. I’m using the default character setup, if that makes any difference. I’ve tried: AddLocalRotation, AddWorldRotation, SetRelativeRotation, and AddWorldOffset- all off of the first person camera. In all of these cases, the camera never rotated like I wanted, although when using add world transform, the camera did become offset from the player model. Then I tried applying the rotation to the player controller with SetControlRotation, and, expectedly, it rotated the whole character, including the controls. I’m not finding a “set local rotation” node. Thanks mind-brain. Yours truly is the braniest of minds.

The camera is in the default first person setup. no bones, at least as far as I know. I’m not sure what a boom is, but I’ll look into it. Thanks, rev overdrive. I’m sure you drive responsibly.

Sorry, It’s “Set RELATIVE Rotation”. Also yeah you want to do it to your camera boom instead of the camera itself. Though, I’m not sure First Person template has a Camera Boom by default, to prevent the player from realizing they’re just arms. You may want to add one for this look-behind use-case!

Hmm, I’ve added a camera boom as the parent of the camera and child of the capsule component and applied the set relative rotation. This rotates the camera component around the mesh, but it doesn’t actually change the direction it’s facing, if that makes sense.

Uncheck Use Pawn Control Rotation under Camera Options when you want to rotate the camera. Otherwise it snaps to the Pawns Control Rotation.

I got good results from this! Give it a try.

That did it! you’re a lifesaver! I think the issue was the inherit pitch/yaw booleans and the use pawn control rotation boolean. I didn’t know that any of those were a thing. Thank you again for your help.

Also, for anyone else doing this, go to the boom component and turn on rotation lag to get a smooth transition between looking ahead and looking behind.

1 Like