Hi! When i create a 2d sprite walking animation with frames and i try to use it in script. Console give me a error “The animation state could not be played because it…” And i research the reason of problem. I find a solution set animation type 2 to 1. I did it but now my animation not working why?
function Update()
{
var movement = Vector3.zero;
// Apply movement from move joystick
var movePad = moveTouchPad;
if ( movePad.IsFingerDown() )
{
move = 1f;
otherAnimator.SetFloat ("Run", move);
movement = Vector3.right * forwardSpeed;
}
// Check for jump
if ( character.isGrounded )
{
var jump = false;
var touchPad = jumpTouchPad;
if ( !touchPad.IsFingerDown() )
canJump = true;
if ( canJump && touchPad.IsFingerDown() )
{
move = 1f;
otherAnimator.SetFloat ("Jump", move);
jump = true;
canJump = false;
}
if(jump==false)
{
move = 0f;
otherAnimator.SetFloat ("Jump", move);
}