Add, move and clamp spline points in runtime

So I’ve followed this tutorial (and its two following parts) to create a system for adding spline walls in blueprints. However, the tutorial focuses on editing splines in the engine but I would like to make it happen in runtime. I’m looking to add and move spline points and also to clamp? spline points so that the player can choose between a sharp corner or a curved one. However, I’m very new to Unreal and so far I’ve not been successful in adding any editing to my current blueprint. Any help and pointers would be welcome!

Here’s my project in case you want to check the blueprint in engine. The spline BP is in Tools folder.

https://drive.google.com/file/d/15-Gvh_AbrV-ztlnisdDyukgmQ5KG_C1k/view?usp=drivesdk

I don’t have time to make anything better than this, but this might help point you in the right direction. To truly manage all the splines and have players able to select different points and set tangent settings for those different points is a much bigger system, but this shows the most basic way to start adding spline points at runtime.

WallSpline

In your Pawn you can get a reference to the spline actor. This is the quick and dirty way to get that reference to your one test actor.

In your Spline BP, instead of only updating spline parameters at BeginPlay, I made a Custom Event that updates the spline whenever you want.

Back in your pawn, you can reference the spline actor, get any location in the world (via a trace here) and add a spline point to the spline at that location. Then call the Update function on the spline actor.

Like I said, there is a lot of other complexity to make it a friendly system for the user, but you can edit quite a lot of spline things in Blueprints as long as you have a reference to the spline component.

1 Like

Thank you so much, this is so helpful! I think I will be able to figure out more based on this.