Explosions' cleanup timer is too primitive to comprehensively wait for VFX time

Explosions automatically parent themselves to nil after a short period of time. This period of time is intended to allow the VFX to play out, but the timer formula does not correctly account for all properties. This results in the explosion particles disappearing before they have a chance to play out, depending on the configuration of the explosion.

Based on my tests, the delay time t seems to only vary with BlastRadius r according to the formula:
r < 1: t = 3
r >=1: t = 3 - 1/r

Here’s the results of my test on a scatter plot, where the noisy values above the line could be attributed to the scheduler not resuming that task immediately:

I’m unsure what the correlation between BlastRadius and delay should be, but I’m guessing the particles expand at a constant velocity, so a larger Radius means it needs more time to expand.

But there’s another important property not being factored in: TimeScale. According to the documentation,

This is a value between 0-1 than controls the speed of the particle effect. At 1 it runs at normal speed, at 0.5 it runs at half speed, and at 0 it freezes time.

So that has a very direct effect on the delay needed before unparenting the explosion in order to let the particles play out, but is not currently taken into consideration.

There may be other properties that also affect the required delay that should be taken into consideration.

Expected behavior

Explosions should not unparent themselves until the particle VFX have finished playing, regardless of TimeScale, BlastRadius, or any other property. It should allow for particles to visually play out and disappear completely.

8 Likes

Thanks for the report! I filed a ticket in our internal database.

2 Likes

Thanks for the report @BusyCityGuy ! We were able to reproduce this and a fix should be available shortly.
Next time, if you’d like to expedite the process, please attach a minimum placefile that demonstrates the problem when just started. Like this one:
ExplosionTimeScale.rbxl (52.6 KB)

1 Like

Thanks for the feedback, I’ll remember to include repro’s in future bug reports.

FWIW, you can repro this without a script very easily.

  1. Open a new baseplate in studio
  2. Insert Explosion into Workspace
  3. Set TimeScale property of the Explosion to 0.1
  4. Press Run
  5. Observe that the explosion effects are still ongoing when the explosion gets unparented after a few seconds

No script is necessary, the only requirement is to be in Run/Play mode so you get the default “Unparent” behavior of the engine.

For completeness, here is a place file created by following the above steps.
ExplosionTimeScale.rbxl (52.3 KB)

It’s important to note, there may be other properties besides TimeScale that affect explosion effect length. There may be other less obvious ways to reproduce this problem. For example, the engine apparently tries to account for BlastRadius, which is not obvious to me how that affects the explosion effects, but the timer apparently thinks it does. Maybe BlastRadius also has an effect? I don’t have visibility into all the factors.

It seems that only TimeScale was not accounted for, and this is now fixed. The fix should be available soon. Once the fix is out, let us know if you find further problems. Thanks!