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.
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)
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.
Thanks . I actually created a new pawn and chosen parent class from the scroll list. Using Blueprint Props was much easy way
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
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.