I get Assets/Scriptshas/EnemyAI.cs(29,71): error CS1525: Unexpected symbol `’
using UnityEngine;
using System.Collections;
public class EnemyAI : MonoBehaviour {
public Transform target;
public int moveSpeed;
public int roatationSpeed;
private Transform myTransform;
void Awake(){
myTransform = transform;
}
// Use this for initialization
void Start () {
GameObject go = GameObject.FindGameObjectWithTag("Player");
target = go.transform;
}
// Update is called once per frame
void Update () {
Debug.DrawLine (target.position, myTransform.position, Color.yellow);
//Look at target
myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
}
}
Problem is between myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime); Which is line 29 in my script, thank you for your time!
Can't say from this limited amount of information. Edit the question to include the rest of the script along with the actual error message. And place a comment on the line where the compiler indicates there is an error.
– robertbuDid you mean to mark a variable as internal, but it has a capital I instead of lower case internal?
– LandernI edited.
– BillyMcTreeSnapIt appears you have some funky characters in your line:29, i would delete the highlighted parts in the image and type them out again, rebuild the scripts and see if that helps. [8814-funkychars.png|8814]
– LandernI retyped the line and got 3 new errors. Assets/Scriptshas/EnemyAI.cs(29,144): error CS0103: The name
– BillyMcTreeSnaprotationSpeed' does not exist in the current context Assets/Scriptshas/EnemyAI.cs(29,51): error CS1502: The best overloaded method match forUnityEngine.Quaternion.Slerp(UnityEngine.Quaternion, UnityEngine.Quaternion, float)' has some invalid arguments Assets/Scriptshas/EnemyAI.cs(29,51): error CS1503: Argument#3' cannot convertobject' expression to type `float'