Why is my spline all mangled on load?

Hey so I’m simply loading my saved assets back into the world.

What I’m doing is saving each point of the spline to the built in struct for spline points, then adding them to an array which saves to an array variable.

This variable is then saved when I click ‘save map’

Note: I subtract the final point from this array as it’s identical to the first point and is just a result of the closed loop.

When I close the game, reopen to test and then load my save, it’s supposed to spawn the saved assets and essentially replicate the spline’s saved data, which is just the points which creates the spline path.

Here’s the code:

And this is the result:

As you can see in the struct variable the spline points and their data are saved and in exact order of creation.
All I’m trying to do is set the points from the ‘for each loop’ which I expect to go through from index 0 to the last index, setting each point as it goes.

Ofcourse this isn’t the result I’m expecting, it’s supposed to be a clean hexagon shape.

Alright quickly solved! I didn’t know this node existed so now I’m going to have to change my entire structure a bit:

hahah bit embarrassing, but a spline component automatically spawns two spline points to create a single segment. If you’re doing anything like I am you need these removed and for the first spline point to begin where the user first clicks.

1 Like