BombChild.cs 379 B

123456789101112131415
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class BombChild : MonoBehaviour
  5. {
  6. public Vector3 velocity;
  7. void Update()
  8. {
  9. velocity.y += -9.8f * Time.deltaTime * 80;
  10. transform.localPosition += velocity * Time.deltaTime;
  11. if (transform.position.y < -(Screen.height / 10)) Destroy(gameObject);
  12. }
  13. }