Breakable Walls FX
Setting up Breakable Walls FX is really simple, just follow these steps:
Select a wall or flat surface from your game.
BreakableWall.csas a new component.
Configure the optional parameters of the script.
Thats it! Now the wall is fragmented and is ready to be destroyed, this could be done either by explosions like its done in the demo scene or in more programatic ways.
BreakableWall.cs is the main script of the project. It
This script works in 3 steps:
The script then iterates through all the voronoi regions of the diagram and for each one of them created a new mesh with the bounds of the region and the depth of the wall. Effectively subdiving the wall into “shards” or “pieces”. Each of these “shards” contains the correct UV coordinates and size making the texture look seamless and making the group of shard look identical to the original wall.
After this procedure the original wall is disabled and its replaced by the newly generated, breakable wall.
The script is pretty extensible and since the voronoi calculations are not done using Unity objects so the parallelization of these calculations can be supported easily.
|Detail for the triangulation. This is more or less equal to the amount of triangles on the given surface.
|Optimization option that only creates front facing part of the mesh for the shard. Useful for far away objects where detail is not needed.
|Layer to set shards on when instatiating them. Useful for making raycasts against them.
We are a small company focused on building tools for game developers. Send us an email to firstname.lastname@example.org if interested in working with us. For any other inquiries, feel free to contact us at email@example.com or contact us on the discord
Sign up to our newsletter.
Want to receive news about discounts, new products and updates?