SO basically, Whenever I press teh play to test the game. One of teh scripts on my enimies like deletes itself, but then when I unlick play and go back to edditing it is there. But when U look in the inspector the script is goen during gameplay. Whyd oes it disapear and is tehre a fix?
Do you have a line in your script that says Destroy(this)? This removes the script from the object it’s attached to.
No I do not this is the script:
var target : Transform;
var damp = 1;
var cool = true;
function Start () {
// Auto setup player as target through tags
if (target == null GameObject.FindWithTag("Player"))
target = GameObject.FindWithTag("Player").transform;
}
function Update ()
{
if(cool)
{
var desiredDirection = target.position - transform.position;
} transform.up = Vector3.Slerp(transform.up, -desiredDirection, Time.deltaTime * damp);
if(Input.GetKeyDown("s"))
{
cool = false;
var desiredDirection2 = target.position - transform.position;
transform.up = Vector3.Slerp(transform.up, desiredDirection2, Time.deltaTime * damp);
}
}
Nothing special ~ And like I said after I un-clicked the testing it shows back up in the editor