Why pawn is not moving

I have created a GameMode, Pawn and added Movement in my Pawn BP Graph. Then changed the game mode and assigned new Pawn in the default pawn class. Nothing happens when I move mouse or use keyboard.

Pawn BP

Input Settings (my key mapping is not logically correct as you can see S is assigned instead of D for movement and also repeated for turning but this shold be not the problem as the same input config working for Character class)

input.PNG

Is it must to have any components in my Pawn class? because there are no components added (not even the camera) in my pawn class. Is there anything I have missed? I have also tried by toggling Use Controller Yaw/Pitch/Roll.

I believe the base Pawn class does not apply any movement when using AddMovementInput. From the docs:

Try using DefaultPawn as the parent class of your Pawn BP instead of Pawn and see if this fixes your issue.

If you use DefaultPawn, make sure to set bAddDefaultMovementBindings to false, otherwise it will setup a bunch of input mappings for you automatically which may cause confusion.

1 Like

How do I change parent class in Blue Print? I am not using C++.

Update: Never mind. I got it. I can choose parent class when I am creating. So noob I am :stuck_out_tongue:

Here is how you can change the parent class of an existing BP:

&stc=1

And here is where you can disable Add Default Movement Bindings:

&stc=1

The input you send to AddMovementInput is affected by the Floating Pawn Movement section as well.

2 Likes

Thanks . I actually created a new pawn and chosen parent class from the scroll list. Using Blueprint Props was much easy way :slight_smile:
I have also unchecked Use Default Mouse Bindings but it didnt worked. The probloem was I did not bind Input keys properly in new project. Thanks for you help

Wow, you got me :slight_smile:

I have a same problem. and I do not want to use defualt pawn. please explain how did you salve your problem

I’m not 100% sure if this is right. But from what I understand the AddMovementInput function just queues up a movement input. You have to call ConsumeMovementInputVector to get the movement input vector. Then from this you can manually change the location of your object using SetActorLocation to [current location vector + movement input vector].
The doc on APawn describes what the functions do. It is vague though.

You need the “FloatingPawnMovement”-Component to move without DefaultPawn.

1 Like