- Home /
cant add script
because of script name doesn't match the name of the file name defined in the script but it does.
here is my code
using UnityEngine;
using System.Collections;
public class EnemyAI: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");
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);
//Move towards target
myTransform.position += myTransform .forward * moveSpeed * Time.deltaTime;
}
}
READ PLEASE here the missining top bit using UnityEngine; using System.Collections;
public class EnemyAI:$$anonymous$$onoBehaviour{ public Transform target; public int moveSpeed; public int rotationSpeed;
READ PLEASE here the missining top bit using UnityEngine; using System.Collections;
public class EnemyAI:$$anonymous$$onoBehaviour{ public Transform target; public int moveSpeed; public int rotationSpeed;
READ PLEASE here the missining top bit using UnityEngine; using System.Collections;
public class EnemyAI:$$anonymous$$onoBehaviour{ public Transform target; public int moveSpeed; public int rotationSpeed;
READ PLEASE here the missining top bit using UnityEngine; using System.Collections;
public class EnemyAI:$$anonymous$$onoBehaviour{ public Transform target; public int moveSpeed; public int rotationSpeed;
@gamedesigner43: Don't buzz us. Just update us with extra information about your question. We can't answer your question like this.
What is the filename of your script?
Your answer
Follow this Question
Related Questions
Can't Add Script: Can't add component 'NetworkManager' 1 Answer
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Null Reference Exception on instantiated object's script. 2 Answers
'thrust' is not a member of UnityEngine.Component 1 Answer
Adding joints through script 2 Answers