Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.
Hi,
I wonder if it’s possible to select or affect multiple objects of the same type which are next to each other. But not the objects of the same type that are not next to those.
Like, in the example below the box marked with an “X” gets destroyed. From there the neighboring boxes are supposed to get destroyed, too (automatically).
But not the ones in the lower right corner (not connected).
How can I do this? I’ve tried a lot using “point inside object” but it doesn’t work. Neither does “collision” since this requires the objects’ collision masks to overlap (I think). But I don’t want them to overlap.
Hi!
what you need is and event with these two properties:
1: the event need to pick objects close to each other. This is done through distance. you basically calculate the distance between two points. the first is the original block that is checked, the second, is all other instances individually. compute this and check if distance is below a certain value.
2: since the original instance must be picked to start the comparison, the picking list must be killed before sub-events can be checked. this is to check all instances (ie. which ones are close?). however, killing the picking list will remove the information of the original position to compare the positions to. Meaning that you must save the position of the original object that get deleted inside a local or scene variable that will serve as a “reminder” of where the deleted object was.
doing this is basically a “state spreading”. like a fire that spreads, or explosions that explode other bombs etc…
here is a solved discussion about state spreading. Status spreading help
I also recorded and edited a video about status spreading, but i procrastinated publishing it. let me know if you want to see it uploaded. (it also talk about self-collision if i remember correctly)