Hey Guys, I am using this code
function OnTriggerStay(other:Collider)
{
if(other.gameObject.tag == "Player" && Input.GetKeyUp(KeyCode.Tab))
{
onOff = !onOff;
for(i=0;i<target.Length;i++)
{
if(!doFunction)
{
if(onOff)
{
target*.animation.Play(anim);*
-
if(wait)* -
yield WaitForSeconds(0.4);*
_ for (var state : AnimationState in target*.animation)_
_ {_
_ state.speed = 1;_
_ }_
_ }_
_ else*_
* {*
_ for (var state : AnimationState in target*.animation)
{
state.speed = 0;
}
}
}
if(doFunction)
{
target.SendMessage(func);
if(!camAnimPlayed && cam)
{
cam.camera.enabled = true;
cam.animation.Play(camAnim);
camAnimPlayed = true;
}
}
}
}
}*
Which kind of works perfectly, but I sometimes have to jab “TAB” more than once, sometimes five times before it decides to work.
Does anyone else experience this, am I doing something wrong?
Any advice would be great!
Many thanks._