Mirroring Splines

Hello,

I’ve been trying to mirror a spline, but what I’ve found is that the Construction Script doesn’t seem able to override spline points placed directly in the world. Can anyone confirm or deny this?

I’ve even tried add and removing spline points, and nothing happens.

Again, to be clear, the spline is edited in the Editor view, not the Blueprint.

Sometime ago made something like this, not sure if you stumbled on it but maybe it helps.

Hello, again, OUTSIDE of the Blueprint, not inside. I don’t think it’s allowed.

Well not sure by you mean by that, but you can put that in world and adjust the spline on actor and would work, but I understand that there could be some limitations depending on what you need.

(Give me a couple of minutes to upload a quick video of what I mean…)

1 Like

Oookay, so the first picture is the blueprint, and the video shows how I add points directly into the world, however, adding points are instanced, so when you look in the blueprint, nothing changes:

Your function (similar to mine) works INSIDE but not OUTSIDE of the blueprint. (Pardon the caps… I’m not yelling at you!)

No worries, I understand the issue now. It seems to be about persistency between the instance and the actual class.

What you want is for changes made in the world to be reflected in the blueprint class.

This is possible, but it’s worth mentioning that any change to the BaseClass propagates to all instances in the world. You probably know this already, but it’s important to keep in mind.

So if you propagate instance changes back to the BaseClass, other instances will also be affected (especially if they rely on construction).

What you need to do is, when you create or modify spline points, write that data to the BaseClass CurrentSplinePoints, then clear and regenerate the spline.

You can also add a function (for example in construction or as a callable editor function) so this doesn’t run all the time, but only when triggered manually, like an “Apply Changes To BaseClass” button that executes the update, so you see changes in your base class.

Does that make sense?

1 Like

It does, and me no want to do that because I’ve already used this class HUNDREDS of times. I’m in too deep man!

For now, I will directly change the scale to get the desired effect.

Yes, this is a no-no, but I only need locations, not rotations (enemies always face the player, so they’re not using the spline’s rotation), and setting X to -1 does this.

Thanks for the confirmation that this is not directly possible!

Yeah, this is generally how the architecture works, so no worries.

If it helps, one workaround you can use is to create a child blueprint from the base class and apply your changes there instead.

That way, you can modify the “ChildBaseClass” when you press an apply button, without affecting all the existing instances of the original base class.

This is a fairly common approach we use in cases like this.

I hear you, but I have a lot of AI that is coded specifically to these spline classes… and I don’t want to touch ANYTHING.

I’ll use my workaround, but I mainly wanted to make sure what I wanted to do (Construction Script → Instanced Points) was not directly possible. And it’s not. I appreciate the clarity.

1 Like