10-Laser Behaviour Scripting

The behaviour of the laser at this point will simply be :

  • Shoot upwards

// translate at a given speed

  • Destroy itself once it shoots out of scene (so the hierarchy is not populated with lasers)

// if transform moves out of the screen
// Destroy the game object

  • (Small touch) Offset the shooting position relative to Player at instantiating, such that it is shooting out of the cube surface instead of the center

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store