Files
ScienceLab.TimeAndSpace/Assets/Scripts/DroneMovement.cs
2026-03-17 18:10:00 +02:00

19 lines
425 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DroneMovement : MonoBehaviour
{
public float speed = 20f;
private bool _moving = true;
public void StopMoving() { _moving = false; }
public void ResumeMoving() { _moving = true; }
void Update()
{
if (!_moving) return;
transform.position += Vector3.forward * speed * Time.deltaTime;
}
}