Making particles collide with scene objects
A great way to enhance the visual effects of Particle Systems is for the particles to behave as if they are a real part of the 3D world. We can easily give this impression by enabling the Collision module, which makes particles change their direction of movement when they “hit” the colliders of 3D objects in the scene.
In this recipe, we’ll create a scene containing some 3D objects and create two Particle Systems – one like a fountain of ping-pong balls and another like a gun firing many small balls in a line. Both sets of particles will bounce and change direction when they collide with the objects in the scene:
Figure 15.19: The two bouncing Particle Systems in the collision scene we’ll create in this recipe
How to do it...
To create a Particle System from scratch, follow these steps:
- Create a new Unity 3D project.
- Move
MainCamera
to Position(0, 1, -20)
so that we...