So I am trying to make a pawn that moves using a movement component. I have a very simple setup so far.
in the .h
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Movement) UCapsuleComponent* CapsComp; UPROPERTY(VisibleDefaultsOnly, Category = Mesh) class USkeletalMeshComponent* Mesh1P; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Movement) UFloatingPawnMovement* MyPawnMoveComp;
in the .cpp
CapsComp = CreateDefaultSubobject < UCapsuleComponent > (TEXT("TheCapsComp")); CapsComp->InitCapsuleSize(42.0f, 96.0f); RootComponent = CapsComp; Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("PlayerSkeleton")); Mesh1P->AttachTo(RootComponent); MyPawnMoveComp = CreateDefaultSubobject<UFloatingPawnMovement>(TEXT("PawnMoveComp")); MyPawnMoveComp->UpdatedComponent = CapsComp;
I have the functions for movement that are used in the third person example bounds to inputs (looking like this):
The problem is that the mesh of the pawn will move but not the capsule. The capsule will stay in place, give off line traces, block objects, do every thing it is supposed to. The mesh will move around, it will move through walls and float just like you would expect if the movement component was assigned to it (but it is not).
Any thoughts on what I am doing wrong or why this might be happening?