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
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.
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)