Move Pawn With wasd BP

Greetings,
So i am trying to create a free camera for an RTS game. You can move the camera around the world and once you select a unit the camera snaps to that unit and can be zoomed in and moves with the pawn. When I started working on this about an hour ago i thought the hard part would be changing controllers/cameras once a unit is selected but unfortunately i have been hung up on a stupid issue for the last 40 minutes.

Like I said I want to be able to move a free camera around the world. So i created a blueprint with a collision sphere then attached a spring arm to the sphere and a camera to the the spring arm. Good so far. I then changed created a controller for the this FreeCamera. I also remembered to change my default controller and pawn in my gamemode to my new FreeCamera and FreeCameraController. Also good so far.

Now for the issue. I added some blueprint code to the controller to have the controlled pawn move using a “add movement input”. I compiled and went to test it out. Nothing moved. I made sure my input mapping was done correctly. I tried multiple different ways to get the pawn to move. I tried moving the code out of the controller BP and into the FreeCamera pawn. I tried using other code that i need worked on my player BP for movement. I made sure my collision sphere was set to move not static. I cant get anything to make this pawn move.

What am I doing wrong? I have exhausted my knowledge and am starting to get frustrated.

Hello,

  • Have you ensured that you’ve set your controller/pawn to Auto Receive Input from your player?
  • Have you set the camera as the default pawn in your game mode?
  • Do you have a Floating Pawn Movement component inside your pawn blueprint?
  • Is there a particular reason you’ve put a collision sphere on your camera?

I didn’t have a pawn movement component in the pawn blueprint. I was unaware that was needed. What is a pawn movement component and what does it do?

The reason for the collision sphere is I am hoping to drive the collision sphere around the map not he camera. That way when there is an increase or decrease in elevation the camera will automatically adjust

I have added a collision capsule to my camera, and it was still moving without issue. Here are some images of my setup:

This image contains my setup of the pawn I’m using for my camera.

66130-freecamerapawn.png

This image shows my movement setup in the CameraController, which is a blueprint based on PlayerController.

Feel free to ask any questions about the setup, or if you don’t understand how I’ve got it working.