[SOLVED] Delete specific instances of object based on distance

I want to delete instances of an object based on the distance to another (moving) object. For example when the distance between the moving object and the instances of the other object is greater than 100 pixels, then delete instances of the object that are further away than 100 pixels. How can I do this easy and simple?

In the snip below, Dino is the player, and Santa is the enemy:

1 Like

Does this delete all instance of the object or just the ones below 200 pixels? Maybe I need to use the ‘For Each’ event?

Try it and see :smiley:

The red rounded arrows at the start inverts the condition. So it actually reads “Select all Santas with a distance not below 200 pixels”.

1 Like

Using ‘For each instance’ works. Thanks for your help!

No, you don’t need to use a for each. The delete removes all objects that meet the conditions. By adding a for each, you are introducing an extra and unnecessary processing overhead.

1 Like

okay, thanks for helping me out