Pawn Actor not Blocking and going through walls.

So im creating a custom Pawn, i already set its movement but is not blocking walls, this is what i have set up on my class constructor for the capsuleComponent. Is there something the character class does that Pawn class doesnt? I think i have to set up something related to the collision manually but i just dont find anything about it, i tried other forums solutions and nothing work.

CapsuleComp = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CapsuleComp"));
CapsuleComp->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName);
CapsuleComp->InitCapsuleSize(34.0f, 88.0f);
CapsuleComp->CanCharacterStepUpOn = ECB_No;
CapsuleComp->SetShouldUpdatePhysicsVolume(true);
CapsuleComp->SetCanEverAffectNavigation(false);
CapsuleComp->bDynamicObstacle = true;
CapsuleComp->SetSimulatePhysics(true);
SetActorEnableCollision(true);
RootComponent = CapsuleComp;

We’d need to see your collision profile for your pawn and for your wall.

You need to set each profile to block each other’s object type. They BOTH need to block each other. If only one blocks the other but not the other way around, it won’t block.

Here’s an example of the setup.

Pawn is object type channel 1
Wall is object type channel 2

Pawn is set to block channel 2
Wall is set to block channel 1

You can do this manually as well if you don’t use profiles. You’d have to remove the call to SetCollisionProfileName();

// Set the object type channels.
CapsuleComp->SetCollisionObjectType(ECC_EngineTraceChannel1);
WallStaticMeshComp->SetCollisionObjectType(ECC_EngineTraceChannel2);

// Set how each object reacts to each other’s channels.
CapsuleComp->SetCollisionResponseToChannel(ECC_EngineTraceChannel2, ECollisionResponse::ECR_Block);
WallStaticMeshComp->SetCollisionResponseToChannel(ECC_EngineTraceChannel1, ECollisionResponse::ECR_Block);

So you need to set the equivalent of this (using the object types you’ve defined in your profiles) and set them to block each other in your profile. That means just update your profiles to block other and no code changes are required.