Download

Delete Instances after Placing in Blueprint

Problem: I would like to be able to delete out certain objects that are placed into my editor from my blueprint construction script.

Context: I created a construction script(Do not want to use Event Graph for this) to help me place objects in my scene at random. It does a good job, however at times there are objects I want to delete out. For example, sometimes an object may block a camera path I like. So, I would like to be able to delete out certain instances but not all of them. This change then needs to be recorded in a way that they would remain upon reloading the model.

Thanks. Feel like this one is a tricky ask.

Add a instance editable string using this. Assuming you are using loops to spawn your instances, if the current loop == any number in that array then don’t spawn and continue spawning the next loop.

edit: better yet, spawn them, add them to an array and check to delete after so you only do 2 loops.

You’ll need something to let you know what # is each instance, perhaps a debug string could help.

One thing though: if you are placing them at random, won’t every time you change something randomize all positions again? If the answer is yes, consider using Random Stream. Other options is to check for specific collision channels on the places you don’t want them to spawn Or this, but it’s out of my scope.

This is how it works… Only downside is Draw Debug String does not work in construction script, only in play.

Thanks for the response. This is pretty much the idea I had in mind. Unfortunately it only works in play.

May have to look at this problem a different way.

Just substitute debug string with Text Render Component and a bool that decides to spawn it or not (toggle on/off in editor).

Like so…
ToggleNumbers