Hi i have a problem, I tried every possible thing that i got in my head but i can’t make it done. the thing is that, I can’t disable object and enable object after 5sec. and theres this (read after code)
var Animator : GameObject;
var WpnHolder : GameObject;
private var gui1 : boolean;
private var doAnim : boolean;
///////////////////////////////
function Update()
{
if(Input.GetKey(KeyCode.Space)&& doAnim)
{
Animator.animation.CrossFade("Climb");
WpnHolder.active = false;
yield WaitForSeconds (5)
WpnHolder.active = true;
}
}
Yes i know that it can not be corountine update() but
i tried this
var Animator : GameObject;
var WpnHolder : GameObject;
private var gui1 : boolean;
private var doAnim : boolean;
///////////////////////////////
function Update()
{
if(Input.GetKey(KeyCode.Space)&& doAnim)
{
Animator.animation.CrossFade("Climb");
WpnHolder.active = false;
wait();
WpnHolder.active = true;
}
}
function wait()
{
yield WaitForSeconds (5);
}
i can’t figure it out,help please