I'm trying to make a simple idle-walk transition in Animator using Unity. I've set a script that changes the Speed value from the Animator, and it works perfectly when I move the character forward when the game is on.
The transitions work well between both animations, except that they don't start automatically after the speed has changed to greater than zero.
I've found out that it waits until the animation loop gets to it's end, which makes the game feel dull and not fluid at all.
I don't think there's an issue with the code, but I'm attaching it anyway:
#pragma strict
var anim : Animator;
function Start () {
anim = GetComponent("Animator");
}
function Update () {
var move : float = Input.GetAxis ("Vertical");
anim.SetFloat("Speed",move);
transform.Rotate(0,Input.GetAxis("Horizontal"),0);
transform.Translate(0,0,(Input.GetAxis("Vertical")*Time.deltaTime*move));
}
No comments:
Post a Comment