This is the script I’m trying to convert from js to C#. It gave me compiler errors, Cannot convert ‘UnityEngine.Vector3’ expression to type ‘UnityEngine.Quaternion’
using UnityEngine;
using System.Collections;
public class AI_Follow : MonoBehaviour
{
public Transform target;
public Transform self;
public float moveSpeed = 3.0F;
public float rotationSpeed = 3.0F;
void Awake()
{
self = transform;
}
void Start ()
{
target = GameObject.FindWithTag("Player").transform;
}
void Update ()
{
//Rotate to look at enemy player
self.rotation = Quaternion.Slerp(self.position, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
self.position += self.forward * moveSpeed * Time.deltaTime;
}
}