top of page

Shooting Mechanic

  • Sheng hao Wang
  • Apr 4, 2016
  • 1 min read

With the player set up, the next part would be creating shooting mechanic for the game. The first step to create the shooting mechanic is the bolt VFX component.

The bolt VFX is basically adding a laser bolt image to a 3D quad then render out the black background by using the particles/additive under the shader and adding rigidbody/capsule collider for the bolt.

With the laser bolt set up, the next step would be writing a simple script in c# to make the laser bolt move upwards and add the bolt VFX to the prefab folder.

Now assign the bolt speed value and test it.

With the bolt working properly, the final step to complete the shooting mechanic would be scripting the shot spawn function to the player spaceship, add the bolt prefab to the player controller script in the Inspector and test it.

Now the player spaceship can fire shoots properly, however there is a problem of the bolt not disappear after leaving the game area which eats up resources of the game. This issue can fix by creating a boundary to destroy object leaving the game area.

Comments


Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page