Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- var velocity: float;
- var timeToLeave: float;
- function Start () {
- }
- function Update () {
- timeToLeave += Time.deltaTime;
- if(timeToLeave >= 4){
- Destroy(gameObject);
- }
- transform.Translate(Vector3.forward*velocity);
- }
Advertisement
Add Comment
Please, Sign In to add comment