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

12 lines
264 B
C#
Raw Normal View History

2025-08-02 19:47:47 +02:00
using UnityEngine;
public class Enemy : MonoBehaviour
{
public float speed = 2f;
void Update()
{
transform.Translate(Vector3.down * speed * Time.deltaTime);
if (transform.position.y < -10) Destroy(gameObject); // Out of bounds
}
}