SHOW:
|
|
- or go back to the newest paste.
1 | using System.Collections; | |
2 | using System.Collections.Generic; | |
3 | using UnityEngine; | |
4 | ||
5 | public class AlienBulletScript : MonoBehaviour | |
6 | { | |
7 | //prędkość pocisku | |
8 | public float speed = 6f; | |
9 | ||
10 | void Start() | |
11 | { | |
12 | //Ustawienie po jakim czasie ma zostać usunięty ten pocisk | |
13 | Destroy(gameObject, 3); | |
14 | } | |
15 | ||
16 | void Update() | |
17 | { | |
18 | Move(); | |
19 | } | |
20 | ||
21 | void Move() | |
22 | { | |
23 | //poruszanie sie w dół, czyli po osi Y | |
24 | transform.position += Vector3.down * speed * Time.deltaTime; | |
25 | } | |
26 | ||
27 | ||
28 | } | |
29 |