Forum rules - please read before posting.

3D Direct Control Walking problem - Player keeps walking after stop pressing key

I've been struggling to get player walking working using AC and the latest version of Unity. I followed the Mecanim character tutorial:

For a while I couldn't get the player to move forward at all. Now the player is walking when you press WASD but then the animation continues (without footsteps) and the player keeps walking forward after you are no longer pressing a key.

I should mention that I sam new to AC and pretty new to working with Mecanim in Unity, so I'm hoping it's just something obvious I'm not doing right.

reference video:

Here are my Player settings:
image
image
Heres my animation setup...
image
image

Thank you!  I've been messing with this for about 2 weeks, I feel like I'm close to figuring it out but I just don't know what else to try.

Claire

Comments

  • clairesquare.  A couple of things you might want to try/look at:
    1) Try using root motion with your character
    2) Make sure you have your MoveSpeed parameter being applied in your animation controller
    3) Take a look at blendtrees - I was doing base level mecanim for a little while and was dealing with some similar issues with animations not really reflecting input/speed and whatnot.  Once I started using blendtrees, it seemed to help quite a bit.  It's not perfect by any stretch (I'm still trying to figure out how to get turn animations to work reliably) but it's much better than it was.
  • edited May 2017
    Probably an issue with your mecanim transitions or the Speed scales in your Player script. Also, You didn't show your other transition. Your walk to Idle seems ok, but the other arrow "Idle to Walk" isn't shown.
    It needs to be MoveSpeed greater than 0.1 (in this case you could actually use a bigger number if you feel like it because you don't have a run). 

    Remember you can use multiple conditions per transition. Imagine you had a WalkSpeed Scale of 2 and RunSpeedScale of 3. If you had a Run, your Idle to Walk transition would be something like "MoveSpeed greater than 0.1" and "MoveSpeed less than 3" for example. This would ensure that the characer walks only when the speed is in the proper range. Then your Walk to Run transition would be MoveSpeed greater than 2.9 ensuring the character runs only when moving the fastest. Now, you must be wondering why 2.9 and not 3? Well AC tends to give the animator MoveSpeed parameter (or whatever you name it) the exact number you assigned in your Player or NPC scripts and mecanim doesn't have a greater or equal comparison (and 3 is never greater than 3).

    But anyway, a screenshot of your other transitions would help.

    I'd also recommend watching Unity's own video tutorials on how to use mecanim too (There's also a lot of tutorials on youtube).
  • Ah sorry here is a picture of the transition from Idle to Walk
    image
  • themightyzqAlverik  I'll go through the Unity Mecanim tutorials and try to make a Blend Tree and see if that helps! Thank you
  • edited May 2017
    Is the character actually walking around the scene when this happens, or just playing the wrong animation and "walking on the spot"?

    Check the value of the Animator's "MoveSpeed" float parameter when controlling the character.  If it appears to be correct (ie. becomes the walk speed when pressing a key, becomes zero when letting go), then the issue will likely lie with the way the Controller's transitions are set up.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.