After testing, we summarize some ideas about how to make particles and objects collide and how to make them disappear after a collision:
First, let's look at the configuration diagram of my particle system:
On the main configuration of collision detection We look at the collision in the picture:
The first item: because it is a 3D game, so here I choose the world
The second item (dampen): suppression (0~1), select this as 1 o'clock (complete suppression), after the collision, block the particles, can make the colliding particles disappear
Third item (Bounce): Bounce (0~2), after selecting this, you can let the colliding particles bounce off at an angle.
Third item (Lifetime Loss): Life cycle loss (0~1), the lifetime of the particle loss percentage after the collision, which is 1 o'clock (complete loss of life), can make the particles disappear
Item fourth (min Kill speed): The minimum purge rate, the larger the value, the faster the particle is removed after a collision, and when a value is reached, it can disappear immediately after the collision.
Item fifth (collides with): Collision range, setting the layer that can collide with the particle system
Sixth (collision quality): Collision quality, set the collision probability size of the collision, option three items from top to bottom from high to low, the lower the probability of collisions to the less
Item seventh (send collision Messages): Send collision information related to the following method
[CSharp]View plain copy
- The collision information that needs to be dealt with is placed on the object being hit.
- void Onparticlecollision (Gameobject other) {
- }
Summarize the following three ways to make a particle disappear:
(1) Set dampen to 1;
(2) Set lifetime loss to 1;
(3) Set a large min Kill speed value
Unity3d How to achieve the collision of particle effects