Procedural Mesh Examples - free!

I just came across your question.

Most of the time if you only want static collision, in other words the RMC itself is not moving, you just need to tell the section to enable collsion either by the flag in CreateMeshSection, or using SetMeshSectionCollisionEnabled like you have here. The one problem with this is don’t expect it to be super fast. Collision in UE4 involves the PhysX cooker which isn’t the fastest thing around. The RMC is getting a slight upgrade to collision probably today actually as long as you’re on UE4.14 preview or above. I’m working on some potentially major upgrades and talking with Epic on the possibilities of this coming to mainline UE4 as to go beyond where the RMC is currently will require engine changes.

Now, if you’re wanting the RMC to have collision and physics enabled where it can move and bounce off things it gets more interesting. The above part with the cooker still applies but there’s another factor. By default the mesh sections use the triangular mesh you supply as the collision surface. The problem is PhysX doesn’t support moving triangular meshes for a list of reasons, and so the only way to get moving collision is using convex collision. Convex collision works fundamentally different, where the triangular mesh is mostly poly perfect collision and can handle convex/concave shapes, convex can only handle convex shapes. The way this is commonly handled for concave objects is to decompose it into multiple convex shapes to approximate the object. That is another slow thing to do usually, so in this case you’d have to probably generate those yourself from whatever is generating the shape.

Hope that helps even though it’s a month late! :slight_smile: