using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyFollow : MonoBehaviour
{
public float speed;
private Transform player;
void Start()
{
player = GameObject.FindGameObjectWithTag("Player").GetComponent();
}
void Update()
{
transform.position = Vector2.MoveTowards(transform.position, player.position, speed * Time.deltaTime);
}
}
using System.Collections.Generic;
using UnityEngine;
public class EnemyFollow : MonoBehaviour
{
public float speed;
private Transform player;
void Start()
{
player - GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>();
}
void Update()
{
transform.position - Vector2.MoveTowards(transform.position, player.position, speed * Time.deltaTime);
}
}
Выдаёт ошибки. Я начинающий так, что плохо знаю об этом...