Time for action – adding laser blasts

A muzzle flash generally consists of two parts. The first is a straight blast, forward along the barrel. The second is a fan around the base of the first.

  1. To begin, create a new particleSystem object and rename it as LineBlast; we will now proceed to make the first part.
  2. The flash does not last for very long, so find the Duration option in the Initial module and set it to 0.1.
  3. Next, we need to set the Start Lifetime option to 0.1 so the particles do not stay on screen for very long.
  4. The flash does not move away from the muzzle, so set the Start Speed option to 1, keeping the particles close.
  5. The particles need to be sized to correspond with the size of our ship's muzzle. Set the Start Size option to 0.2 to keep ...

Get Unity Android Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.