Character Animation Script

By Jack Eaves
This script will control how the character animates when you press 'Up''Down'"left' etc.
MUST split the animation use 'Split Animation' box and setting up which frames are for each animation.


function Update () {


if (Input.GetButton("Left")) { 
if (Input.GetButton("Forward")) { 
animation.CrossFade("WalkForward"); 
if (Input.GetButton("Backward")) { 
animation.CrossFade("WalkBackward"); 
else { 
animation.CrossFade("SidestepLeft"); 
if (Input.GetButton("Right")) { 
if (Input.GetButton("Forward")) { 
animation.CrossFade("WalkForward"); 
if (Input.GetButton("Backward")) { 
animation.CrossFade("WalkBackward"); 
else { 
animation.CrossFade("SidestepRight"); 
if (Input.GetButton("Forward")) { 
animation.CrossFade("WalkForward"); 
if (Input.GetButton("Backward")) { 
animation.CrossFade("WalkBackward"); 

}
 

0 comments so far.

Something to say?