praca_magisterska/games/unity/magisterka_1/Assets/Bullet.cs

13 lines
264 B
C#

using UnityEngine;
public class Bullet : MonoBehaviour
{
public float speed = 10f;
void Update()
{
transform.Translate(Vector3.up * speed * Time.deltaTime);
if (transform.position.y > 10) Destroy(gameObject); // Out of bounds
}
}