hello I am having error with script I try to make ai target player using line 13 and 14
but don’t work is there a different way to do this? I get this error Assets/Scripts/general scripts/EnemieAI.cs(17,40): error CS1525: Unexpected symbol GameObject', expecting
)‘, ,',
;’, [', or
=’
using UnityEngine;
using System.Collections;
public class EnemieAI : MonoBehaviour {
public Transform target;
public int moveSpeed;
public int rotationSpeed;
private Transform myTransform;
void Awake(){
myTransform = transform;
}
// Use this for initialization
void Start () {
GameObject go GameObject.FindGameObjectWithTag("Player");
GameObject = go.transform;
}
// Update is called once per frame
void Update () {
Debug.DrawLine(target.position, myTransform.position, Color.cyan);
//look at target
myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
//move towards target
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
}
}