2D sprite not changing animation upon xy axis change
I have a 2D Sprite that has been scripted to randomly move around the scene and I've made a blend tree that on the test window shows it changes animation depending on the direction it moves but for some reason that does not take effect when its moving by itself ? Any help? do I need to change the animator or add in a change to the script?
Answer by kmart94 · Sep 25, 2019 at 05:02 AM
Can you post some of your code? This question is pretty broad so there could be any number of things going wrong. There should be a script controlling the animator and updating it with the sprites current velocity. That way the animator can change to the proper animation depending on the velocity it is passed. This doc might be useful to you https://docs.unity3d.com/ScriptReference/Animator.SetFloat.html
please upvote my most recent question if this is helpful! Question is below https://answers.unity.com/questions/1667524/how-do-contact-filters-work.html