Need help in creating Pawn Movement Component С++

Good day to everyone.
I’ve faced the problem of understanding what do i really need to create my own working PawnMovementComponent.
To be more specific, i can tell, what exactly i’m trying to do.
I have PawnBase pawn, and 2 derived classes: PlayerPawn, and EnemyPawn. The one we play and the many we play against. I was going to setup AI to controll EnemyPawn. So my decision was to implement custom PawnMovementComponent in PawnBase to avoid copying or changing movement code in derived classes. But i can’t really understand how to do that. I’ve found [that][1] tutorial, and it looked pretty suitable for my needs. But when i try to implement my PawnMovementComponent and call something like

//PlayerPawn.cpp    
MovementComponent->AddInputVector(GetActorForwardVector()*AxisValue);

From my PlayerPawn, unreal throws an error whein it goes to executing that line of code

//PawnBaseMovementComponent.cpp
MoveUpdatedComponent(DesiredMovementThisFrame, UpdatedComponent->GetComponentRotation(), true);

and i guess, that it somehow connected to physics

, idk, my pawn doesn’t need one to move, cause its’s floating. Does anyone know, what should i do, cause i’m stucked. May be i need another function to move my non-physics pawn in movement component, or it should work, but i screwed up at something else?
Would be very grateful for ur assistance, or advice about how i should implement my Ai goal using other tactics.

1 Like

What is the exception that got thrown?