O'Reilly logo

Unity Android Game Development by Example Beginner's Guide by Thomas Finnegan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required