How to implement trace collisions on vertex painted Static Mesh Actors?

I’m having a really difficult time trying to figure out how to get collisions to work on our Static Mesh Actors. Right now, we’re using static mesh actors with painted vertices as map terrain, and I’m trying to implement traces so players can click and interact with the terrain. I’m aware of the method of creating simple collision boxes in the static mesh editor, but we plan on having the painted vertices being dynamic, so the collision models will also be changing during run time.

Currently, I’ve been trying every combination of checkboxes with the words “trace”, “collision” and “complex/simple” in them that seem to be related, and I’ve had no luck at all getting a trace to hit the actors. For implementation, the I’m using the blueprint function Single Line Trace by Channel to try to hit the static mesh actor.

Relevant Blueprints:


These are the test settings I currently have on one of the test actors.


Does anyone have any recommendations where to go here? I’m really banging my head against the wall trying to figure out why it seems impossible to get these traces/collisions to work.

Hi Marcus,

It sounds like you want to modify your collision at runtime based on the user modifying the terrain. Is this correct?
It sounds like you’re going to need support for arbitrary meshes since the user could modify it in unpredictable ways.

For this to work at runtime you will need to use runtime physics cooking, which we support. We don’t have any components that use this out of the box yet, but effectively you’ll want to inherit from the CollisionDataProvider interface which allows you to specify collision.

The community has had a few threads about this where they’ve gotten procedural collision and meshes working.

https://forums.unrealengine.com/showthread.php?2695-Implement-Runtime-Collision-Detection-for-Procedural-Generated-Meshes

We are very interested in supporting this feature and would like to get it as an easy to use component, but I don’t have any ETA on that right now.

Hello,

We think this post contains useful information which we would like to share with our public UE4 community. With your approval, we would like to make a copy of this post on the public AnswerHub which includes the discussion but strips out your username and company name. Please let us know if you are okay with this.

Thanks!

That’s fine with me, go ahead.