I have a transform var on my script. And I want to drag and drop something from the hierarchy to the var slot in the inspector, but I cant. It highlights as if it will drop, but it remains to say "none" also, I was able to do it once! I dropped a none-prefab object from the hierarchy to the Inspector, and now I cant do it. I've been trying on this for days and you can understand my frustration.
also, I can drop prefabs into the var slot, but only prefabs. Here's my script if that helps.
var LookAtThis : Transform;
var elaser : Transform;
var damp = 2;
function Update () {
if(Vector3.Distance(LookAtThis.position,transform.position) < 800){
var rotate = Quaternion.LookRotation(LookAtThis.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotate,damp * Time.deltaTime);
transform.Translate(0,0, 10 * Time.deltaTime);
}
}
InvokeRepeating("fireAtPlayer",1,2);
function fireAtPlayer() {
if(Vector3.Distance(LookAtThis.position,transform.position) < 800){
Instantiate(elaser,transform.Find("espawnpoint").position,transform.rotation);
}
}
function OnCollisionEnter(hit : Collision) {
if(hit.gameObject.tag == ("Player"))
Debug.Log("Watch it!");
}