heyy guys , i’m trying to learn the basis of game animation and programming. I’ve been getting this error and don’t know what to do . This is the script please tell me whats wrong
var PlayerState : float ;
var PlayerAnimSec : GameObject ;
function Update ()
{
PlayerstateController ();
PlayerAnim ();
}
function PlayerstateController ()
{
if ((Input.GetAxis("Vertical")!=0 ) ( Input.GetAxis("Horizontal")!=0) )
if (Input.Get ("sprint"))
{
PlayerState = 2;
}
else
{
PlayerState = 1;
}
else
{
PlayerState = 0;
}
}
function PlayerAnim ()
{
if (PlayerState == 0)
{
PlayerAnimSec.animation.CrossFade("idle", 0.4);
}
else if (PlayerState == 1)
{
PlayerAnimSec.animation.CrossFade("walk", 0.4);
}
else if (PlayerState == 2)
{
PlayerAnimSec.animation.CrossFade("run", 0.4);
}
}