# how i can make a collision of a trail?

**URL:** <https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, editor, Blueprint, question\
**Created:** [March 8, 2025, 3:38am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331 "2025-03-08T03:38:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juzerx27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juzerx27](https://forums.unrealengine.com/u/Juzerx27)\
**Post date:** [March 8, 2025, 3:38am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/1 "2025-03-08T03:38:34Z")

</div>

i been trying to make a collition for a trail of a vehicle like in tron: legacy but i dont know how to do it, i tried to add collition to the ribborn that you may see in the image attached

 ![image_2025-03-07_223258145](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/1/e91cb6825f7a288b6c0436ff88bb86af2aec2878.jpeg)  
i don’t know what i should add or do, can someone guide me please?

---

<div class="post-metadata">

**Author:** ![AliceHalley](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alicehalley/32/1033330_2.png) [@AliceHalley](https://forums.unrealengine.com/u/AliceHalley)\
**Post date:** [March 8, 2025, 12:07pm UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/2 "2025-03-08T12:07:24Z")

</div>

You will need to spawn a sequence of Box collisions that conform to the trail.

Ideally, manage these box collisions inside a single Actor/Component for the sake of performance. But the logic flow should look roughly like this.

Record Location of Vehicle as [PriorVehicleLoc] …then… When Vehicle has moved a Distance\>[RibbonResolutionDist] Create a Box collision with a length equal to the distance between [PriorVehcileLoc] and [ActorLocation]. Assign each Box collision to a Map/Struct with a [Lifetime] equal to the lifetime of your Trail.

Keep track of these Collisions in your map, and tick their lifetimes down by Delta time every tick.  
When a box’s lifetime is \<=0, destroy it!

It can seem a bit faffy, but this is generally how things like this are handled in games.

[RibbonResolutionDist] will need a strike a good balance between accuracy and optimization. too.

---

<div class="post-metadata">

**Author:** ![Juzerx27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juzerx27](https://forums.unrealengine.com/u/Juzerx27)\
**Post date:** [March 8, 2025, 3:40pm UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/3 "2025-03-08T15:40:01Z")

</div>

thx for the response!, i’ll try and show you the results, i was trying recently with instanced static mesh like this:

 ![image_2025-03-08_103716542](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/6/4464d6d15309780af0cea92da327c029363df95d.jpeg)  
but now that i got your response, i’ll try that, thx!

---

<div class="post-metadata">

**Author:** ![eray\_ozr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eray\_ozr](https://forums.unrealengine.com/u/eray_ozr)\
**Post date:** [March 8, 2025, 9:29pm UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/4 "2025-03-08T21:29:31Z")

</div>

> **[GizmoSystem/Source/GizmoSystem at main · Frozen-Projects/GizmoSystem](https://github.com/Frozen-Projects/GizmoSystem/tree/main/Source/GizmoSystem)**
>
> Contribute to Frozen-Projects/GizmoSystem development by creating an account on GitHub.

My runtime gizmo plugin (Position system finished, I am working on Rotation system) has a custom collision box feature (it is finished, too). You can define any shapes with TArray and you can change its shape at runtime.

Each FVector represents a vertex position.  
You can do like this.

- Create a spline
- Get position from at every for example 10cm (depends on your smoothness requirements)
- Offset and store them for three times (for thickness and height). (1st set original; 2nd set 10 cm left; 3rd set 200 cm above; 4th set 10 cm left and 200 cm above)

---

<div class="post-metadata">

**Author:** ![AliceHalley](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alicehalley/32/1033330_2.png) [@AliceHalley](https://forums.unrealengine.com/u/AliceHalley)\
**Post date:** [March 9, 2025, 9:53am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/5 "2025-03-09T09:53:44Z")

</div>

You’re along the right lines! Switch those to box collisions and set the right length based on how often you’re spawning them and you’re on your way!

---

<div class="post-metadata">

**Author:** ![eray\_ozr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eray\_ozr](https://forums.unrealengine.com/u/eray_ozr)\
**Post date:** [March 9, 2025, 3:52pm UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/6 "2025-03-09T15:52:50Z")

</div>

curved lines won’t be good.

---

<div class="post-metadata">

**Author:** ![AliceHalley](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alicehalley/32/1033330_2.png) [@AliceHalley](https://forums.unrealengine.com/u/AliceHalley)\
**Post date:** [March 10, 2025, 7:55am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/7 "2025-03-10T07:55:41Z")

</div>

They would be absolutely fine. It’s a high speed vehicular game. If there is at least one box collision per 2 metres the resolution of the collisions wont be noticeable.  
At the very least, if it becomes a concern, you can increase/decrease the resolution based turning angle.  
But I don’t that will be necessary as in Tron vehicles typically crash almost perpendicular to the line.

---

<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:** [March 10, 2025, 9:10am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/8 "2025-03-10T09:10:47Z")

</div>

> [@Juzerx27](#):
>
> i don’t know what i should add or do, can someone guide me please?

Consider the `Spline` + `Spline Mesh Component` combo. The mesh can be deformed to make it follow spline curvature closely, collided against, the spline can be further subdivided if needed, it’s pretty performant if you do not update _the whole thing_ every frame; instead, update only the last 2-3 segments to keep tangents consistent - something you also have easy access to.

---

<div class="post-metadata">

**Author:** ![Juzerx27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juzerx27](https://forums.unrealengine.com/u/Juzerx27)\
**Post date:** [March 29, 2025, 5:36am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/9 "2025-03-29T05:36:33Z")

</div>

> [@Juzerx27](#):
>
> i been trying to make a collition for a trail of a vehicle like in tron: legacy but i dont know how to do it, i tried to add collition to the ribborn that you may see in the image attached
> 
> ![image_2025-03-07_223258145](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/1/e91cb6825f7a288b6c0436ff88bb86af2aec2878.jpeg)  
> i don’t know what i should add or do, can someone guide me please?

i got a solution for my problem, i used splines and mesh splines like @Everynone said so i did this code in the constructor to add a count of splines

 ![image_2025-03-29_001941552](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/5/3f519b6282dd011b5e8bce5d46230a1055df5030.png)  
and this code for following the movement of the motorcycle in the event graph in the vent tick:  
 ![image_2025-03-29_002035559](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/9/019e963c53fa5e56092e832841cdca33c2f5a090.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/b/6eb164473fd8e0ad7b1203dd2da3e492bb92f026.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/c/4fc834f68efd358beeb26eabada5a5f206a57ae2.png)

and then i added a spline mesh component its created based on the count of points of the spline in the constructor script

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/6/f76d18c72f368dcb5d4519a3d9736ea6bff131f5.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/8/a9869b143b455e3958686db18b43f16ca6477b47.png)

and to make the spline mesh i did this code in the event graph in the event tick:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/7/8275993cc5638a5132931263976b80c492282603.png)

and the final result its something like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/d/b/8dbff0b1430fb49ef6fb68e672c1c19577a5a766.jpeg)  
now, its easy to resolve my problem just adding the collition to the mesh and etc, ill see if i leave the mesh visible or something else.

NOTE: if youre going to use the graphs the variables/numbers you can change if you ever need to its the alpha on the lerp to make it to follow faster your target, if you want more “breaks” in the spline just add it to the count variable.

if you want the trail/spline follow an object i highly recomend creating an scene object to get the ref to what to follow

thx to the ones that helped me into finding the solution @AliceHalley @Everynone !

---

<div class="post-metadata">

**Author:** ![Juzerx27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Juzerx27](https://forums.unrealengine.com/u/Juzerx27)\
**Post date:** [April 1, 2025, 3:05am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/10 "2025-04-01T03:05:09Z")

</div>

update: I was wrong about a lot of things, like in the spline mesh because it was causing a lot of lag by adding the collition and executing it at the event tick, and adding the lerp, it was causing to not follow the ribborn trail, instead i did this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/1/2/312c535703f644ab6872b271695c077b9d488bc0.png)  
[ignore the instanced mesh, i did that because i was thinking that it will resolve the issue, but no] i deleted the lerp and anything related to it, then i added this nodes  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/c/c6cb83cabd0eae511c588dec549c16cf7ef2ecda.png)  
and disconect all of event tick and set it to timers, so it updates every time i want, and thats it, this is my final result:

[LightCycleDemo](https://streamable.com/yvh2e6)

ignore the spline mesh, it can be set hidden in game

---

<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:** [April 1, 2025, 9:00am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/11 "2025-04-01T09:00:27Z")

</div>

> [@Everynone](#):
>
> it’s pretty performant if you do not update _the whole thing_ every frame; instead, update only the last 2-3 segments to keep tangents consistent - something you also have easy access to.

As above, you only need to update the 1-3 last segments. Not all of them… There would no need to run any loops whatsoever - which are the slowest thing in BPs.

* * *

Admittedly, there’s a lot of ways to accomplish something like this.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [May 1, 2025, 9:00am UTC](https://forums.unrealengine.com/t/how-i-can-make-a-collision-of-a-trail/2380331/12 "2025-05-01T09:00:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
