Saturday, December 28, 2013

Space Shooter Day 6

  Today work main on the scripting for bullet. First I create new game object (aka the socket) and attach it to the current player to create area where bullet will be shot from. At first the bullet stood in place and did not move forward, but then when an additional translate code was added. Later the bullet was able to accelerated.

bullet in motion

I was unable to show on this blog a moving bullet but here is kind of what it look like.

However the mistake in this script is that bullet is not destroyed upon shooting, it instead continue to move upward into space forever. Which is not what I wanted to do. In the end I will need to figure out how to make the bullet disappear when it came into contact with the "enemy" game object.

[Update]
By Using destroyed I was able to make bullet disappear when it hit the height limit.

code for destroy 


No comments:

Post a Comment