I just upgraded to the Unity 5 beta, to check out it's features. As a result, my animation system is now broken. It looks like in Unity 5 that the new Entry node is causing the animation to constantly transition to the default node. Is there a way to work around this? I just don't entirely understand when/how the Entry node transition is used. I understand that the problem lies somewhere else (below): My animation code is somewhat like this: Code (CSharp): AnimationClip walkAnimation AnimationClip stopAnimation void FixedUpdate() { Debug.Log( rigidbody2d.velocity.x ); // Check if the character was stopped by, e.g., a wall if ( rigidbody2d.velocity.x < 0.01f ) { _animator.Play(stopAnimation.name); } else { _animator.Play(walkAnimation.name); } Vector2D targetVelocity = new Vector2( 2.2f, 0 ); rigidbody2d.velocity = targetVelocity; } The printed velocity is not "2.2" each frame, as you would expect, but actually something like: Code (CSharp): Velocity: 2.0 Velocity: 0 Velocity: 0 Velocity: 0 Velocity: 2.0 Velocity: 0 Velocity: 2.0 ...etcetera Because the animation code detects whether the character is "stopped", the animation goes nuts: Why is the reported velocity "0" in so many frames?!
This should probably go in the Physics or the Unity 5 board. Apologies, I didn't go through the list. Could a mod move it, please?
I did some more debugging. I replaced my entire animation code with the following simple component: Code (CSharp): using UnityEngine; using System.Collections; public class Motion : MonoBehaviour { // Use this for initialization void Start () { } void Update() { Debug.Log ("Update " + Time.deltaTime); } // Update is called once per frame void FixedUpdate () { Debug.Log ("Fixed " + Time.time); Debug.Log ("Velocity: " + GetComponent<Rigidbody2D>().velocity ); GetComponent<Rigidbody2D>().velocity = new Vector2(0.5f, 0); } } And I logged the output. Every time after a regular Update() occurs, the velocity in the next FixedUpdate() is 0. What is this I don't even?
Oh so it was the Animator! It was stopping my objects even though the transform isn't animated! Is this a U5 bug?
Could you try do a further verification instead of only else? Here: Instead of: Code (CSharp): else { _animator.Play(walkAnimation.name); } Do: Code (CSharp): else if ( rigidbody2d.velocity.x > 0.01f ) { _animator.Play(walkAnimation.name); } I honestly dunno if that could help, but it creeps me out that sometimes the else state covers a lot more than what we want. Or did you already fix it?