# Collision Detection of Spline Meshes at Runtime

**URL:** <https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527>\
**Category:** Blueprint\
**Tags:** collision-detection, spline-mesh-componen, unreal-engine, editor, Blueprint, question\
**Created:** [February 9, 2023, 7:18pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527 "2023-02-09T19:18:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spudnik\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spudnik\_1](https://forums.unrealengine.com/u/Spudnik_1)\
**Post date:** [February 9, 2023, 7:18pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/1 "2023-02-09T19:18:13Z")

</div>

Hey everybody,

I’m having an issue detecting collisions of spline meshes that are generated at runtime. I set up an actor that allows me to drag out a simple 2-point spline that stretches a mesh across its length. Now I want to set up a way of detecting if two of those actors overlap.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/b/e8b4f6883f70d37169f5d7415dfd8287898b1ece.jpeg)  
(this shows the debug view of collisions, they’re definitely there.

Here’s the mesh being spawned:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/c/f3cedda8e251a48fb43e3965917fde9867598e4a.jpeg)

And here’s the relevant code:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/b/77b4e4b0c9edcf450559e578c02297023e0c6e78.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/5/cf5321e9d5b3993e3c85654e3b04ba0262aa1012.png)

The events being triggered by the “on Component begin/end overlap” are just Prints for now.

Here’s an example of how they’re supposed to work:

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/6/26647666aeeb708ad6035a2e79a9c65acc157533.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/6/26647666aeeb708ad6035a2e79a9c65acc157533.mp4)

The curious thing is that placing them in the map before run time and moving another actor close generates responses:

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/5/015bc0648c24b9233c74fb9d139c5cc8fe9b39bc.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/5/015bc0648c24b9233c74fb9d139c5cc8fe9b39bc.mp4)

But moving the same actor into a editor-placed version of itself does not:

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/8/368420072dde646b2a3be1620431a4fc6a5e9b47.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/8/368420072dde646b2a3be1620431a4fc6a5e9b47.mp4)

Any and all help is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Detach789](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Detach789](https://forums.unrealengine.com/u/Detach789)\
**Post date:** [February 9, 2023, 7:35pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/2 "2023-02-09T19:35:39Z")

</div>

I don’t know much about splines, but since it seems like they are all going to be straight lines that (I assume) don’t move around in game, you could try just doing a line trace from one end to the other. You can have it ignore the actor doing the trace.

If there is a possibility of multiple overlaps there is even a multi-line trace, but that one is kind of wonky to use sometimes so you might want to watch a video on it.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 9, 2023, 8:45pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/3 "2023-02-09T20:45:36Z")

</div>

Open the mesh you use for the SMC and set Collision Complexity to `Use Complex as Simple`. Not guaranteed to help here but worth trying. Dynamically generated spline mesh collision shape deformation is notoriously iffy in general.

* * *

Also, as suggested above, you could probably (sphere) trace from A to B instead.

---

<div class="post-metadata">

**Author:** ![Spudnik\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Spudnik\_1](https://forums.unrealengine.com/u/Spudnik_1)\
**Post date:** [February 9, 2023, 10:18pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/4 "2023-02-09T22:18:32Z")

</div>

@Detach789 Absolutely, that would definitely be a solution for this concrete situation, but a) I’m still very curious about why this isn’t working as you’d expect and b) if I want to include more than two points for a non-straight spline down the line, it doesn’t work any more

@Everynone The videos above are set to `Use Complex as Simple` and produce the results you see. If I set it to `Simple as Complex` it definitely does _something_, but the results are inconsistent at best, it seems to only trigger close to the origin:

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/9/6396483303ccd10daac2ad25991d4e6ce3b154d6.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/9/6396483303ccd10daac2ad25991d4e6ce3b154d6.mp4)

---

<div class="post-metadata">

**Author:** ![HDDigitalDesigns](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HDDigitalDesigns](https://forums.unrealengine.com/u/HDDigitalDesigns)\
**Post date:** [May 2, 2023, 4:22pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/5 "2023-05-02T16:22:13Z")

</div>

Did you find a solution to this? I am in a similar situation.

I have a spline & spline mesh that is generated on BeginPlay in C++. I have the sample mesh collision complexity set as “Complex as Simple” and the spline mesh collision is set to “Query and Physics”.  
I do a line trace from the start to the end of the spline but the line trace doesn’t return a hit with other spline meshes.

---

<div class="post-metadata">

**Author:** ![VostokSTZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VostokSTZ](https://forums.unrealengine.com/u/VostokSTZ)\
**Post date:** [January 24, 2024, 6:13pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/6 "2024-01-24T18:13:51Z")

</div>

I’m trying the same but with roads. Have you found the solution for your line trace problem? Maybe try the Multi Line Trace?

---

<div class="post-metadata">

**Author:** ![brandavm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@brandavm](https://forums.unrealengine.com/u/brandavm)\
**Post date:** [April 18, 2025, 1:37pm UTC](https://forums.unrealengine.com/t/collision-detection-of-spline-meshes-at-runtime/767527/7 "2025-04-18T13:37:21Z")

</div>

The only thing that worked consistently for me was to add the Spline Mesh Component in the Construction Script, set the Static Mesh, then call **Set Collision Enabled** with Collision Enabled and **Set Collision Responses to All Channels** with Block.
