Disclaimer: This is mostly a self-made question and answer post, similar to a community wiki post on StackOverflow.
Question: How do I use AddForce() in an APawn?
Disclaimer: This is mostly a self-made question and answer post, similar to a community wiki post on StackOverflow.
Question: How do I use AddForce() in an APawn?
Need this in the constructor:
AMyPawn::AMyPawn(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer.SetDefaultSubobjectClass< UMovementComponent >(TEXT(“Movement”)))
Make sure that SetSimulatePhysics flag is set to TRUE in both the class object (called either in BeginPlay() or in the constructor) and in the UE4 Editor (Properties/Details when you click on a (UBoxComponent, USphereComponent, UCapsuleComponent, etc. collider volumnes).
Use AddForce(FVector Force of any vector) in your Tick(float Delta) override function.
Couldn’t you have used ACharacter instead of APawn?