How can I undo the last spline mesh I placed at runtime?

So far I have a spline tool, it’s awesome but I want to be able to undo the last spline point I made aswell as delete the last spline mesh I created.

I’ve tried alsorts and this blueprint here I have does almost what I need it to do but in the wrong order whether I use for each loop or reverse for each loop, the deletion of mesh components always starts at index 0 and I can’t seem to flip them.

Bare in mind this is all for runtime usage, not in-editor

Does -- work here?


When you add SMCs, add them to an array:

Remove last point (by segment), Destroy Component, then remove the last SMC entry. The order of operations matters here.


Note that this does not necessarily guarantee order of elements (afaik), so I’d be careful around using it for this. Making an array out of 1 item makes little sense anyway.

I see now I should have added them to an array, it makes perfect sense. I don’t know why it didn’t occur to me that I could just do that tbh. I’ll give this a try and report back asap Thank you! :slight_smile:

UPDATE: This works perfectly and I’ve just learned a very important principle. I can’t thank you enough for this @Everynone

1 Like