Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class AlienBulletScript : MonoBehaviour
- {
- //bullet speed
- public float speed = 6f;
- void Start()
- {
- //Destroying the bullet after 3 seconds
- Destroy(gameObject, 3);
- }
- void Update()
- {
- Move();
- }
- void Move()
- {
- //Moving down (along Y axis)
- transform.position += Vector3.down * speed * Time.deltaTime;
- }
- }
Add Comment
Please, Sign In to add comment