var Playerstate : float;
var PlayerAnimSec : GameObject;
function Update ()
)
PlayerStateController();
PlayerAnims(); around here is were it is wrong
)
function PlayerStateController()
(
if ((input.GetAxis(“Vertical”)!=0 ||input.Get Axis(“Horizontal”)!=0)
(
if (input.Getbutton(“Sprint”))
(
Playerstate = 2;
)
else
(
Playerstate = 1;
)
)
else
(
Playerstate = 0;
)
)
function PlayerAnims()
(
if (Playerstate == 0)
(
PlayerAnimSec.animation.CrossFade(“Idle Animation”, 0.4);
)
(
else if (Playerstate == 1)
(
PlayerAnimSec.animation.CrossFade(“Walking Animation”, 0.4);
)
else if (Playerstate == 2)
(
PlayerAnimSec.animation.CrossFade(“Sprint Animation”, 0.4);
)
-
Formatted code (looks like there are no curly braces, code is as in the above original post) :
var Playerstate : float;
var PlayerAnimSec : GameObject;function Update ()
)
PlayerStateController();
PlayerAnims(); around here is were it is wrong
)function PlayerStateController()
(
if ((input.GetAxis(“Vertical”)!=0 ||input.Get Axis(“Horizontal”)!=0)
(
if (input.Getbutton(“Sprint”))
( Playerstate = 2; )
else
( Playerstate = 1; )
)
else
(
Playerstate = 0;
)
)function PlayerAnims()
(
if (Playerstate == 0)
(
PlayerAnimSec.animation.CrossFade(“Idle Animation”, 0.4);
)
(
else if (Playerstate == 1)
(
PlayerAnimSec.animation.CrossFade(“Walking Animation”, 0.4);
)
else if (Playerstate == 2)
(
PlayerAnimSec.animation.CrossFade(“Sprint Animation”, 0.4);
)