i've created this script:
var lifeTime = 1.0;
function Awake ()
{
if (lifeTime <=0)
{
GetComponent("AI script Looking").enabled = true;
}
}
there are no errors but it doesn't work at all, i want it to turn on after time... thanks all :D
DaveA
2
Where does lifeTime change? It's never negative. Try this (there are many ways to do this):
var delay = 1.0;
var startTime = 0.0;
function Awake()
{
startTime = Time.time;
}
function Update ()
{
if ((Time.time - startTime) >= delay)
{
GetComponent("AI script Looking").enabled = true;
}
}