Walking Animation Issue

Okay I have been working on this for hours trying to fix it!

So firstly I should mention I’m using UFPS.

I have my model with animations hooked up with idleanimation and walkanimation, all work in the preview wrap mode set to loop on both. The models rig is set to legacy.

I have an animation on the camera and the script to go with it is.

Something simple just to test it.

It simply does not work I feel like its supposed, but doesn’t. If I delete the animations the script tells me it cant find the animation meaning its working. No errors when the animation is on the camera. Yet no animation plays!?

function Update () {
    if(Input.GetKey("w")) {
        animation.CrossFade("walkanimation");
    }
    else if(Input.GetKey("a")) {
        animation.CrossFade("walkanimation");
    }
    else if(Input.GetKey("d")) {
        animation.CrossFade("walkanimation");
    }
    else if(Input.GetKey("s")) {
        animation.CrossFade("walkanimation");
    }
    else 
        animation.CrossFade("idleanimation");
    }

This tutorial series has one tutorial on bones and another on animation. I’ve had no problems with my animations conducted under the guidance of this series, so I urge you to try it.

Bones: Unity 3D Tutorial Part 14: Playing With Bones - YouTube

Animation: Unity 3D Tutorial Part 15: Basic Animation - YouTube

I hope that this helps you. If it doesn’t do so, then please notify me. I consistently check my answers for replies at least every two days. If it does help you, please accept it properly, because so many people don’t do that and it gets the answer-giver an additional 20 karma each time.