Pawn stuck in air

I have just recently started with Unreal Engine and I am running into a bit of an issue when spawning a pawn – it doesn’t respond to physics. I am creating my class, AEnemy, which inherits from APawn. The only place I am doing anything at the moment is in the constructor:

// Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;

// Create Capsule
CollisionCapsule = ObjectInitializer.CreateDefaultSubobject<UCapsuleComponent>(this, TEXT("Collision Capsule"));
CollisionCapsule->InitCapsuleSize(50, 125);

// Simulate physics with the collision capsule
CollisionCapsule->CanCharacterStepUpOn = ECB_No;
CollisionCapsule->bCanEverAffectNavigation = false;
CollisionCapsule->bShouldUpdatePhysicsVolume = true;

// Collision capsule is the root component
RootComponent = CollisionCapsule;

// Create movement component
MovementComponent = ObjectInitializer.CreateDefaultSubobject<UCharacterMovementComponent>(this, TEXT("Enemy movement component"));

// Movement component is collision capsule
MovementComponent->UpdatedComponent = CollisionCapsule;

// Load the mesh
// TODO: Allow this to change in blueprints
const ConstructorHelpers::FObjectFinder<USkeletalMesh> Mesh(TEXT("SkeletalMesh'/Game/AnimStarterPack/Character/HeroTPP.HeroTPP'"));
StaticMesh = ObjectInitializer.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Mesh"));
StaticMesh->SetSkeletalMesh(Mesh.Object);
StaticMesh->AttachTo(RootComponent);
StaticMesh->SetRelativeLocation(FVector(0, 0, -100));
StaticMesh->bShouldUpdatePhysicsVolume = true;
StaticMesh->SetCollisionProfileName("Pawn");

I have been following the code in ACharacter and ADefaultPawn, but I’m not sure what I’m doing wrong. It seems I can’t even explicitly move the pawn in the tick function by calling

MovementComponent->AddInputVector(FVector(1.0, 0.0, 1.0));

The best I have been able to do so far is changing the collision type in the editor, but the pawn either falls through the floor or bounces around the level and flies off.

Essentially this is just a class that inherits from APawn and only has the code provided above in the constructor to set up everything.

I am aware of the ACharacter class, but was writing this one to not restrict myself to standing characters.

Also, if anyone has any tutorials or anything they would recommend, that would be great. I’ve mainly been using the tutorials in the Unreal documentation and the documentation itself, but there seems to be a lot that it doesn’t cover. Many of the tutorials that I have found only use blueprints or just aren’t very good.

UPDATE: This even seems to be happening if I inherit from ACharacter, although it seems that the CapsuleComponent in ACharacter behaves as expected. Maybe I have an issue with trying to simulate physics by the mesh instead of a capsule?