Error!!!

I’m creating and FPS game and I just wrote my enemy AI script. For some reason on line 30 I keep getting this Error: Assets/Scripts/EnemyAI.cs(30,17): error CS0118: EnemyAI.myTransform' is a field’ but a `type’ was expected.
Anyone know how I can fix it?

using UnityEngine;
using System.Collections;

public class EnemyAI : MonoBehaviour {
    public Transform target;
    public int moveSpeed;
    public int rotationSpeed;
    public int maxdistance;
   
    private Transform myTransform;
   
    void Awake(){
        myTransform = transform;
    }
   
   
    void Start () {
        GameObject go = GameObject.FindGameObjectWithTag("Player");
       
        target = go.transform;
       
        maxdistance = 2;
    }
   
   
    void Update () {
        Debug.DrawLine(target.position, myTransform.position, Color.red);
       
       
        myTransform****tation = Quaternion.Slerp(myTransform****tation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
       
        if(Vector3.Distance(target.position, myTransform.position) > maxdistance){
            //Move towards target
            myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
           
        }
    }
   
}

I hope line 30 doesn’t look like this:

myTransform****tation = Quaternion.Slerp(myTransform****tation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);

Does your code really have those ****?

Edit: Fixed code tag

1 Like

Yeh, is there something I should do instead?

Learn to code! It is very obvious that you don’t know what you are doing.

It is most likely supposed to be myTransform.rotation instead of myTransform***tation.

I am new to coding, trying to learn, Thanks for the help!!!