Hello! I am VERY new to unity and am trying to make a basic AI. If somebody could help me with this code it would be very helpful!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SkeletonAI : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Vector3.Distance(Player.position, this.transform.position) > 10)
{
Vector3 direction = player.position - this.transform.position;
this.transform.rotation = Quaternion.Slerp (this.transform.roation);
Quarternion.LookRotation(direction); 0.1f);
}
}
}