using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MinionAI : MonoBehaviour {
public Transform target;
public int rotationSpeed = 5;
public Transform myTransform;
private void Awake()
{
myTransform = transform;
}
// Use this for initialization
void Start () {
target = GameObject.FindWithTag("node2").transform;
}
// Update is called once per frame
void Update () {
var moveSpeed = 5;
myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
}
}