meshBurstEffect - A function that explodes a Mesh

meshBurstEffect

A function that explodes a MeshPart or a model that contains a MeshPart(such as a character).

model link

Use Cases

1. Balloon pop

2. Character explosion

3. Car explosion

How to use

  1. Go to the Security tab in your game settings and enable Allow Mesh/Image API.
  2. Place MeshConvert under the parent of this module script.
  3. Require this module script and use it like a function.

Example code

local meshBurstEffect = require(script.meshBurstEffect)

meshBurstEffect(workspace.Car, {partAmountInUnion = 60, blastPressure = 30})
14 Likes

Finally, now we can have
freddy-freddy-fazbear
in ROBLOX.

8 Likes

The problem with this resource is that, it creates unions at runtime, and depending on your mesh, it may create too many. Notice how the physics simulation couldn’t keep up with the amount of unions at example 2?

The ideal way is to fracture a mesh in Blender, and import the fractured mesh back into Roblox. The fractured mesh will contain the mesh split into individual MeshParts, and you can perform destructive physics on them with no penalty to performance.

While this tutorial mentions Godot, you only should focus on the “Creating fractures In Blender” section in the tutorial.

5 Likes

Obviously, for practical use it is better to import an already fragmented mesh.
This modulescript attempts to implement MeshPart fragments by creating a union of multiple parts using MeshConvert, so performance is slow.
I think it would be quite useful in Roblox to use EditableMesh to create a separate MeshPart for each piece of the MeshPart, and to be able to create pieces in advance when the game starts and explode them when desired.

2 Likes

I’m getting error: Please ensure InputType or MeshData is correct

repro:
repro.rbxl (107 Bytes)

1 Like

Go to the Security tab in your game settings and enable Allow Mesh/Image API.

1 Like

And the amount of Unions that occur can be reduced by increasing partAmountInUnion.
Also, when dividing the mesh and importing it to create this effect, if the amount is large, lag will occur as shown in the example.

My point stands, doing this during runtime is not ideal. Remember that when you are developing on Roblox, you are developing for embedded devices.

You also can not use this resource in live games (you can still use them in studio afaik) because Editables* is locked behind an ID requirement.

Your option is to turn this into a plugin that fractures a mesh beforehand.

1 Like

Due to recent updates, this resource can be used in live games. And if you disable CanCollide for each Union (requires modifying the source code), it won’t lag.

1 Like

You’ve missed the ID requirment.

This problem can be easily solved by having people using this module verify their ID.

that’s not possible for everyone though. some people may not be willing to hand over their id to roblox, and some people’s ids simply don’t work.

1 Like

I didn’t know there was such a problem. It’s probably one of the bad points of EditableMesh right now. Thanks for letting me know. I’ll think about why I should use this module despite its shortcomings.