Next: , Previous: , Up: Combat   [Contents][Index]


6.2 Beam Laser

Component: BeamLaser

This component should be attached to a muzzle transform object representing the origin of the laser from the gun. Toggling this object on or off will enable/disable the laser beam. The laser does damage every update while active. It extends from the muzzle transform to ’Beam Range’ in front of the weapon. It does not spawn a separate projectile object, thus saving memory and CPU over a very fast ’Bullet’ and also giving an effect that moves with the weapon, whereas a ’Bullet’ will maintain it’s original trajectory after leaving the weapon. Since the object is never destroyed, pooling is not necessary on mobile.

Field of BeamLaser: LayerMask hitRayMask

A Layer Mask indicating which objects this beam can hit. It will pass through anything not tagged with this mask, and deal damage to anything it hits that has a ’Health’ component, or any other component that can receive the ’ModifyHealth’ message

Projectile Settings

Available Messages

Message on BeamLaser: ToggleOn ()

Turns on the beam

Message on BeamLaser: ToggleOf ()

Turns off the beam

Field of BeamLaser: LayerMask hitRayMask

A Layer Mask indicating which objects this beam can hit. It will pass through anything not tagged with this mask, and deal damage to anything it hits that has a ’Health’ component, or any other component that can receive the ’ModifyHealth’ message

Projectile Settings

Available Messages

Message on BeamLaser: ToggleOn ()

Turns on the beam

Message on BeamLaser: ToggleOf ()

Turns off the beam


Next: , Previous: , Up: Combat   [Contents][Index]