Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var timer : float = 1.0;
- var prefabBullet : GameObject;
- function Update ()
- {
- timer -= Time.deltaTime;
- if (timer <= 0)
- {
- //Fire! But... maybe later.
- var instanceBullet = Instantiate(prefabBullet, transform.position, Quaternion.Euler(0,0,0));
- timer = 1.0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement