Ok, so i have my animations and there on my model and the script is on there but when i play i get an error : **MissingMethodException: UnityEngine.Animation.CossFade**
var PlayerState : float;
var PlayerAnimSec : GameObject;
function Update ()
{
PlayerStateController ();
PlayerAnims ();
}
function PlayerStateController ()
{
if ((Input.GetAxis("Vertical") !=0 || Input.GetAxis("Horizontal") !=0))
{
if (Input.GetButton("Sprint"))
{
PlayerState = 2;
}
else
{
Playerstate = 1;
}
}
else
{
PlayerState = 0;
}
}
function PlayerAnims()
{
if (PlayerState == 0)
{
PlayerAnimSec.animation.CossFade("Idle Animation", 0.4);
}
else if (PlayerState == 1)
{
PlayerAnimSec.animation.CossFade("Walk Animation", 0.4);
}
else if (PlayerState == 2)
{
PlayerAnimSec.animation.CossFade("Sprint Animation", 0.4);
}
}
↧