Download

How to dynamically creat spline that avoids collision

Hello, everyone!

I am trying to create a spline component that automatically self-modifies when it collides with an actor.
Someone has any idea on how to do this? :smiley:

Hi [MENTION=276543]CamXil Studios[/MENTION],

Im not sure what you mean with “Self modifies” but I will assume you mean “move out of the way”.

If this is the case, you could spawn a collision sphere / box on each spline point (as you are adding each spline point in the constructions script) and On Hit event, break the hit and grab the impact normal. Then use that normal to move the spline point in the opposite direction by a set amount. This is not perfect as you may have sections of the spline that arent “covered” by the collision boxes. It may also be hard to determine which spline point to move based on the hit location.

Keep in mind I’ve never tried doing this so this is how I would start investigating this.