i want to stop the animation once i release out pressing the “q” button… I really need your help guys… ![]()
this is my code…
function Update ()
{
if (Input.GetKey(“q”) )
animation.CrossFade (“run”);
animation[“run”].wrapMode = WrapMode.Loop;
}
i want to stop the animation once i release out pressing the “q” button… I really need your help guys… ![]()
this is my code…
function Update ()
{
if (Input.GetKey(“q”) )
animation.CrossFade (“run”);
animation[“run”].wrapMode = WrapMode.Loop;
}
As written, the CrossFade code is only called when “q” is pressed, and the wrapMode setting is always set each update.
Depending on your intention you may need to add some brackets to your “if” statement.
function Update ()
{
if (Input.GetKey("q") ) {
animation.CrossFade ("run");
animation["run"].wrapMode = WrapMode.Loop;
} else {
animation.Stop();
}
__
thank you guys! ill try those codes when i arrive at home… :0