Real time spline creation help!

Hi,

I’ve been building a painting mechanic that uses splines that are spawned as the game is played, as in when you click a spline is created and as you drag the mouse points are added, the mesh’s are spawned on those points,
the blueprint is set up so that each point and mesh can only be spawned when the mouse is a certain distance away from the old point (about 0.02) which works perfectly unless you drag the mouse extremely quickly in which
the points get placed further than that away creating big gaps between the spline points/mesh’s.

I’ve been trying to come up with a way for the blueprint to figure out if its more that 0.02 away from the last point and then fill in more points/meshs as to close up the gap however I have failed many times for about a week now,
could anyone lend a hand and help me fix this, thanks :slight_smile:

My current blueprint set up :

How it looks in game if you draw slowly (no gaps):

How it looks in game if you draw fast(gaps):

screen1.PNG

Instead of spawning black paint at a spline point, try getting the spline length. When you spawn one black splotch mesh, add its X bounds to a float variable.

While this float is less than the length of the spline, keep adding splotches and adding to the float variable.

Eventually, you’ll have splotches all along the spline from beginning to end. If the spacing is too much by just add X bounds, multiply X bounds by something - something less than 1 for less spacing, some greater than 1 for more spacing.

Thanks for the reply will try that now :slight_smile:

Is there a way to keep the execution line running until the spline distance equals the x float? The function its currently in stops as soon as the mouse isn’t clicked,

This is what I’ve got at the moment and the same issues persist :

Use a while loop for that :slight_smile: