How to properly rotate the camera attached on a spring arm of a Top Down Character?

I am trying to modify the Top Down Game to have a functionality to rotate the camera when you press the right mouse button. I understand that the TopDownPlayerCharacter has a spring arm with the rotation set to “Absolute”. This makes the camera at a fixed angle even if the TopDownPlayerCharacter rotates while moving around the Nav Mesh.

I added an Input Mapping for Right Mouse Button and whenever it is pressed, I set the value of the variable “IsAbsoluteRotation” to false, then assign this value to the absolute rotation of the spring arm. If the Right Mouse Button is released, the “IsAbsoluteRotation” is then set to be true. However, the spring arm does not seem to update its absolute rotation. The camera remains to follow the TopDownPlayerCharacter’s rotation.

I am new to using UE4 and no previous experience on creating a game. Am I doing the right thing here? Is there any other way of doing it like having a CameraPawn follow the character?

Thank you.

I got it working using this blueprint for the TopDownCharacter.

1 Like

It’s good to see that you got it working…

I’ve spent a lot of time working with Spring Arms and Camera components… and I think I can help you out if you show me an example of the movement you’d like to see. Maybe a link to a youtube video of the kind of game you are using as a reference? :slight_smile:

In my humble opinion, there are usually more effective ways than using Set World Rotation / Set World Position (it’s a very brute force method, that usually works against the way the Spring Arm / Camera component is designed to be set up)

I am trying to emulate the camera settings of Ragnarok Online, if that makes sense. The TopDownCharacter already has an spring arm attached to it. It has the rotation set to absolute so that it will be independent of the characters rotation while moving. But then, by pressing the Right Mouse, the user will be anle to rotate the camera around the Z-axis.

I will try to upload a video to make it clearer and maybe you can point me to a better solution.

Thank you.

I found Ragnarok on YouTube… looks cute! Here you go… set it up much like these two screenshots for starters… there might be a popping when you switch to “rotate camera”. If the popping happens, just comment here and I’ll help you out :slight_smile:

Hello ANorthStar,

Here is the link to the video of what I have done so far. I move the character with left mouse button and rotate the camera using right mouse button. Just a quick question though. I am using world rotation, does that mean that if this is a multiplayer game, everyone’s world rotation will be affected?

I will try to use your blueprint and let you know. If it worked, I will mark you answer as the correct one.

your game looks nice and moves well :slight_smile:

Your setup will work fine for multiplayer (you are rotating your camera in World Space, not rotating the world and the other multiplayers won’t need your camera movement coordinates, just your other relevant pawn info).

I know it might feel like a step backwards, but for performance reasons (i.e. FPS) and maybe to take advantage of useful Spring Arm features (like nice-looking camera rotation and speed lag that really smooths things out nicely) I’d approach it another way. Imho, your way is great for prototyping though

I tested you suggested blueprint. However, it does not suit what I try to accomplish. But I do appreciate your time answering my questions. Thank you.

You are a genius. Adding to Yaw input is what I was looking for!