Trigger explosion?

Hi all,
Im currently working on a D-day project. On the beach I need some artillery explosion happening “randomly”. How should I proces with this? Will it be a normal triggerbox with sounds, ect. Or are there any thing way better for this? Any Youtube tuts or docu for anything better? :ice_cream:

Thanks!

I’m sure there are many ways to achieve that. But the first thing that comes to my mind is to create a looping setup with random bool to determine if an explosion should happen at the loop beginning and if yes, continues to spawn your explosion elements on designated or totally random locations.

Don’t know, maybe there is an easier way.

Maybe you can be more specific about your scene. Is it an ambience type of thing or more about gameplay? Because there is surely something more efficient than my first idea.

2 Likes

Something like this? A blueprint Actor in the level that randomly fires off the ‘BoomBoom’ event that can spawn particle explosions and sounds … you can put a bunch in the level. The spawning can be set to give random locations…

1 Like

IMO a single actor could be enough:
DDay
image

1 Like

Hi, Yea sorry. Its for gameplay!

Hella nice! How “demanding” would it for gameplay? And could it be attach to any triggers, so its only happens while the character are In the “zone”?

Thanks!

I was going to draw some ugly demonstration but this looks like the way it should be.

as long as you don’t set the frequency to wild numbers, I wouldn’t say that the performance will take a damage from spawning a few simple vfx elements.

you can use “Set Actor Tick Enabled” node to turn down the ticking when the character leaves the scene

2 Likes
  • IMO It should be a lot less than spawning actors per explosion. VFX can be pooled and a trace of some sort is still needed assuming terrain won’t be flat.
  • The tick should cost very close if not the same as using timers since it’s doing what a timer does ((float -= delta) <= 0.0) except that this loop is done in blueprint, not c++. Either way 1 or a few won’t hurt much. If anything just set the tick interval to 1/30 or more.
  • A vector3 can be exposed to change the bound in the constructor per instance, though the idea is to use a single actor and just set the bound to cover the playable area.

There’s not much more to it than that.

The box collision used can enable tick when the player begins overlap and turn tick off on end overlap. Just make sure to test that the box detects the player overlap if the spawn is inside.

DDay2

Ofc it can also be adapted to “turn on” by any type of event.

2 Likes

Hi,

Sir, you are a god Among men. Thanks so much! Apperently, my coding skills arent at This level xD
Are there anyway This code can be uploaded to the blueprint upload, so I can do a C/P?
So basically This code, will be all I need In the coding ascept?
Sorry for all my questions!