How do you make the camera rotate with WASD keys in top down style game?

I working on a top down style game and need to be able to rotate the camera . Anybody know how?

You can also implement a custom camera class in C++ that does WASD panning and rotation; that’s how we did it.

To rotate the camera, you can use Get InputAxis MoveRight to to determine which direction to rotate. You can multiply the output of that node by your rotation speed (just an arbitrary float variable in my example) and the delta seconds (another float variable; this one pulled from the Event Tick node) and make a rotation from the result using Make Rot. If you’re looking down the Z-axis, you’ll want to plug the result into the yaw. Once you create your rotation, you can then use your camera’s Add Relative Rotation node to rotate it. Here’s my it might look:

Also, if that doesn’t work try unchecking “Use Controller View Rotation” under “Camera Settings” on your camera component and see if it works then

I’m really new to this. What does the Pawn Camera come off of? Is there another part to this blueprint? Is it the My Controller blueprint?

Well, I meant to rename that block “Camera Rotation” and didn’t notice my mistake until much later. But, anyway…

That’s part of my player pawn (not a character; what I’m doing doesn’t involve walking around) and the “Camera” node is a reference to a camera component that’s attached to the pawn. Additionally, the Event Tick node is what drives everything in that blueprint.

Also, the Get InputAxis MoveRight node is from my axis mappings in Edit > Project Settings > Engine > Input.

So you know the full picture, just in case the information is useful to you… Basically what I did is create a new pawn blueprint class to serve as the pawn that the player controls, set it as the default player pawn in the game mode settings, set it up visually, and then attached a camera component to it and made it orthographic. I have it looking down the Z-axis (I had to uncheck “Use Controller View Rotation” to get it to work; I haven’t yet looked into why). In mine, I actually have the blueprint snippet I showed you above controlling the rotation of the pawn itself and the camera follows the rotation of the player pawn and I negate the created rotation and add that into the camera component’s rotation to keep it at its initial rotation. Of course, this isn’t really what you’re looking to do and is just the first thing that I tried that got the results I wanted – so I don’t know if it’s a good way to go about what I’m trying to do – but there it is, just in case it helps :slight_smile: