Compound Collider with Physics and Meshes

Hi!

I’m trying to find the simplest way to set up a capsule collider which simulates physics and has no renderer. I want to have static meshes, with no collision, as children of the capsule.

This seems like the go-to approach:

This is basically perfect but I want to make a small change. I want the origin of my blueprint to be at the bottom of the capsule, not in the middle. In my example, because the capsule collision is the root, the origin is centred like this:

Some may suggest that I just use an offset when reading or setting the actor location but I’d rather not do that.

So, assuming I absolutely want to change the origin of my blueprint, a common suggestion is to use an empty Scene component as the root and position everything else within that, which would work, but the root component’s position will never change. If I ever read the actor location I’ll just get the location of the unmoving root scene component instead of the position of the capsule. I’ll just have a floating actor root sitting in the scene which has nothing to do with the physical position of the capsule. I could get a reference to the capsule component and always use that when getting the actor location but I’d rather not do that; I want my actor’s location to represent the location of the capsule.

Another suggestion then might be to create the collision mesh using some external software or to use a modelling plugin, and then I can fully control the origin of the capsule but then I completely sidestep the very useful capsule collision component which lets me freely alter the height and radius of the capsule collision, not to mention the fact that a capsule collision is more efficient than a mesh collision shaped like a capsule.

It would be great if I could just have a root component which has physics and no collision and I could build the collision using primitive collision child components. But I feel like this isn’t possible.

Maybe I could set the root as a static mesh which simulates physics but has no mesh assigned? But that feels really hacky.

1 Like

You may need to hack around it:

  • get any mesh, here a cube but it can be a single triangle
  • remove all collision, add a capsule and offset it:

  • the actor will use this “static mesh”'s collider:

  • actor location is at the centre of the mesh
  • hide the mesh

Could that work for you?

Good to know. Thanks for the answer.