Rotating the player camera


Use a Matinee sequence to your camera, it will move the camera, rotate smoothly, anything you wants:

Good Luck

I’ve been stuck with this issue for the past 3 days or so – thought I’d finally push myself to ask for help:

When the player approaches and interacts with terminals in my current project, their camera is supposed to move closer to the terminal itself and rotate to be perpendicular to it.
I’ve managed to get the camera to move fine, but it refuses to rotate. I’ve tried rotating the CapsuleComponent of which the Camera is a child, but that doesn’t work either.

I can, however, still rotate the camera using my mouse (was thinking about adding Angle Clamps to limit the movement of the camera once it rotates properly).

Here’s the function that controls the movement and (I had hoped) rotation of the player’s camera:

What’m I doing wrong here? I’m at a complete loss and everything I’ve tried hasn’t worked…

I thought about using a Matinee but I’m unsure…
The movement of my camera is based on the player’s location and an arrow component that exists in the Terminal actor.

By that I mean that the camera moves from the player’s position to the arrow in the terminal, so I’m unsure if that’s possible with a Matinee?

I’d prefer to not have to make a Matinee for each terminal I create if possible, so as to save time, but if I really don’t have any other option I guess I’ll need to.

Have you tried setting bUsePawnControlRotation on the camera to false?

That worked! Thank you! I had a feeling it was something really simple that I was missing. ^^

Great! Happy to hear it :slight_smile: I converted my comment into an answer, if you’ve got what you need out of this thread.

Would you also happen to know what causes the camera to snap back to it’s original Pitch after doing the MoveComponentTo?

The Yaw of the camera moves back to it’s original position just fine, but the pitch remains unchanged and snaps back to how it was only when I set UsePawnControlRotation to true.

Sorry…is this the move to terminal, or the move back to the player where the pitch isn’t reflecting what you expect?

In the “AttachTo” function, your attach type is “Keep World Position”. That means it’s going to keep the relative location & rotation offsets that it has at the moment you attach. Assuming you want the exact same location & rotation as the capsule component, you can use the Snap To Target attach type.

The move back. Moving to the terminal rotates fine.

Snap To Target seems to snap the camera to the origin point of the actors, though, which causes the camera to jump to that point before moving to it’s original position.

I want a smooth transition (hence the MoveComponentTo nodes with both Ease inputs enabled) between the screen and the cameras original position, so any snapping is a no-go for me.

Can you just snap to target directly to the original position and avoid that jump?

Gotcha. Yeah, you’ll want to keep your original attachment method then. I think you just need to set the controller rotation to be the same as camera before you set UsePawnControlRotation to true.

I’ll keep experimenting, then.
Thanks again. ^^

You could use a Timeline.

I “dough” not comprehend