I have make an gameObject with a Bubble Material
I want make an effect ,when i click this gameobject ,it bursted and destroyed .
how can I do it ? using ParticleSystem? or anything else?
Yep, a particle system would work well. Have a look at a bubble bursting in slow motion. Pretty amazing.
I’d recommend the following:
-
add a mesh particle emitter to the gameobject. (as well as particle renderer and particle animator components)
-
set the energy of the particles very low (0.1-0.5) so that the animation is very short
-
disable the particle components by default
-
add a script to the gameobject along with a function with the following (javascript by the way):
function Die(){
renderer.enabled = false;
GetComponent(“ParticleEmitter”).enabled = true;
GetComponent(“ParticleRenderer”).enabled = true;
yield WaitForSeconds(.5);
Destroy(gameObject);
}function OnMouseDown() {
Die();
}
Instead of using a mesh, you can emit from an Ellipsoid Emitter.
Set the size of the ellipsoid to the size you want the bubble to be, and set Min Emitter Range to that same distance.
This will force all the particles to be emitted at the surface of that ellipsoid.