How to make TNT explosion affect all near TNTs?

Hi, I want to make the TNT crate from Crash Bandicoot, I have got it to work as intended but only when I activate either the first TNT or the very last TNT, if I activate any TNT between the first and last one the result doesn’t work as intended.

How do I…

Make any TNT explode as a result of another exploding near it

What is the expected result

No matter which TNT activates, any TNT near it also explodes when the countdown is over

What is the actual result

If I don’t activate the first or last TNT, not all TNT end up exploding, even though they are very near the explosion distance

Related screenshots

Event

Video Example

Not sure if I explained it properly, but in case here’s a video example of what happens

It’s the second to last event that’s the issue. When you jump on the second crate, it explodes and sets off the two explosions on either side, they then both explode but only one will get processed because of the trigger once condition.

Getting rid of that trigger once will fix it, but it’ll cause a different issue with the TNTExplosion particle system getting created multiple times for each crate.

I think the simplest solution is to:

  1. add another boolean variable to the TNT object, named “HasExploded”.
  2. replace the second to last event’s “Trigger once while true” condition with TNT.HasExploded = false.
  3. add an action to the second to last event that sets TNT.HasExploded to true.
1 Like

At first it didn’t work, but I added a “repeat for each instance of TNT” and now it works as intended no matter which TNT gets activated, the boolean is a lot better than trigger once cause I remember using repeat + trigger once and it didn’t work, thanks a lot!

1 Like