Essentially what I have set up right now is that when I press “Q” or “E” my camera spring arm rotates around my pawn 90 degrees in the respective directions.
Now the problem I’m having is when I rotate the camera I can’t figure out how to get it so my players movement input rotates as well.
For example: If I’m pressing “W” to move forward and then I rotate my camera 90 degrees I want my player to turn and move forward in the direction the camera is now facing. All it does now is it keeps moving forward in the original direction and I now see the side of the player.
So after searching through the Third Person Template for the special magic that allows the character to walk forward in the direction the camera is facing, I found that there wasn’t much special that lets that happen. But I did manage to solve my problem from doing so. I decided since the Third Person Character already has a “camera view based movement” system by default where as the Top Down was designed for point and click and not camera magic. I replaced the Third Person camera setup with mine and transferred all of my other code over. That way there was none of that “move mouse to look” functionality that I don’t want. I did how ever keep the node behind the “mouse look.”
This is the blueprint setup that allows the camera to rotate 90 degrees in either direction around the player via custom input titled “CameraRotateLeft” and “CameraRotateRight”.
In order to get my player to also change his forward motion when I press “W” to match the new direction the camera is looking, I use the “Add Controller Yaw Input” node that was previously used to allow the mouse to move the cameraboom around the player and thus changing the movement direction.
I did try to use this same node setup in the Top Down Character’s Blueprint but it doesn’t work. I’m not sure why it only works with the Third Person Character and not the Top Down Character but it’s no big deal.
Here is a gif of the final camera product in action working as I originally intended it.
As you can see, when the camera rotates 90 degrees while pressing “W” to walk forward, the player automatically changes his forward motion to match the forward view of the camera. I also do the twirl to show that all other directions are still in tact and that the player can move independently of whichever direction the camera is facing.