Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- /*
- * --Bullet_Unit.js
- * @author: Paul Scharnofske
- * @version: 1.0.0
- *
- * This Script have to be bound to the bullet witch have to be shoot.
- * In this Script the bullet get it's movement and this Script also vanish
- * the first bullet (the sample bullet). (its not vanished but hidden
- * because of the position)
- */
- // Distance witch the Bullet moves per Frame.
- var distance : float = 1.5f;
- // Counter to vanish spawnbullet.
- var count : int = 0;
- // Updatefunktion executed every new Frame.
- function Update () {
- // Let the Bullet move forward. (Here is a mistake)
- transform.position = transform.position + transform.forward * distance * Time.deltaTime;
- // For the first 25 Frames the bullet will vanish (be at a position you can't see it.)
- if(count != 25) {
- // Moves the Bullet below the Structure.
- transform.position.x = -5;
- transform.position.y = -5;
- transform.position.z = -5;
- // Resets Rotation.
- transform.rotation.x = 0;
- transform.rotation.y = 0;
- transform.rotation.z = 0;
- // Count variable "count" up.
- count++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement