What exactly is going wrong? Is your pawn not blocking (going through walls)? Or is not generating the blocking events in C++?
For the latter: Call Mesh->SetNotifyRigidBodyCollision(true) and override AActor::ReceiveHit
Note: If your mesh already has a collision mesh associated with it through the editor then you don’t need a capsule component.