SavePoge/Assets/Scripts/Enemy.cs
2023-02-01 20:09:15 +05:30

15 lines
346 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
public float moveSpeed = 0.1f;
void FixedUpdate()
{
if (GameManager.Player == null) { return; }
transform.Translate((GameManager.Player.position - transform.position).normalized * moveSpeed);
}
}