Pawn Movement with Complex Collision

I have a custom pawn using a static mesh as the root component. I’m moving the pawn by using the Floating Pawn Movement component. Collisions work fine when using any of the simple shape primitives, but I wanted to fine-tune the collision shape with a custom mesh. I created one in Blender and set this as the complex collision mesh and changed the complexity to “Use Complex Collision As Simple.” When running the game, the pawn didn’t collide with anything, as if it had no collision object set. After debugging for a while, I tracked this down to the code in WorldCollision.cpp:

#if WITH_CHAOS
			if (!Shape.GetGeometry().IsConvex())
			{
				//We skip complex shapes. Should this respect complex as simple?
				continue;
			}
#else
			if(ShapeType == ECollisionShapeType::Heightfield || ShapeType == ECollisionShapeType::Trimesh)
			{
				//We skip complex shapes. Should this respect complex as simple?
				continue;
			}
#endif

In the debugger, I saw that the geometry inside of Shape is using a Trimesh as expected, but convex is always set to false, even when the mesh being used is convex. I tested in UE5 (WITH_CHAOS=1) and UE4 (WITH_CHAOS=0) and in both cases it skips the mesh.

So it seems that the object being moved can never use a complex collision mesh, it must always be one or more simple shapes. Note that meshes the pawn collides with can have complex collisions (set mesh with Use Complex Collision As Simple) and work properly, just not the shape being moved.

As a workaround I’m using multiple capsule components to approximate the mesh, since neither the K-DOP or auto convex options produced a good fit.

I wanted to share in case anyone else ran across this and wondered why their complex collision doesn’t work on a pawn, and also to see if anyone else had some more insight. I assume this was done this way due to performance and/or code complexity.

1 Like

I have the same problem. I use a complex mesh for collision and set “Use Complex Collision as Simple”. Then no hit events are produced and my pawn just moves through other objects. When i use another mesh with simple convex shaped the collision is working.

Any update if this behaviour could be changed?