15 lines
346 B
C#
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);
|
|
}
|
|
}
|