Forum rules - please read before posting.

Character moonwalks on direction change

Hello! I've been having an issue with my main character's walk cycle that I've not been able to get rid of, no matter the amount of fiddling with destination accuracy and acceleration/deceleration, so I thought I should see if this is known, or I'm just doing something silly.

I'm using point and click control, and I start the character walking. After a moment, I click somewhere else which, nine times out of ten, causes him to turn around, and start walking to the new target. The remainder of the time, the character turns to face the new target, animates as though he's walking that way, but continues to move towards the first destination. Sometimes, he'll move to the new point, but very slowly, as though still being pulled. It is more likely to happen if the character is walking towards a hotspot target, and also if they are running.

The problem stops happening if I turn off root motion, but then a whole lot of animations that are dependent upon it (e.g. walking up stairs, climbing on top of things) no longer work. Before 1.50, this didn't seem to happen, though perhaps I'm just imagining that.


Additionally, it also happens when using direct control of a character (as shown in second part of the video). Changing to move in the opposite direction will cause the character to slide on the spot.

Comments

  • I also have this issue.

    Your youtube video is set for private.
  • edited March 2016
    Oops! I've changed the video setting, so it should work publicly now.


    Also, matrix211v1, is it something you've noticed happening recently as well, or is it something that's been going on longer?
  • I had a problem similar to that, the solution for me was to make sure the "Has exit time?" on the animator transitions are UNchecked. 
  • edited March 2016
    @Technocrat: It could be a combination of both your character set-up and your movement settings.  Hard to say without seeing.  That the character faces the wrong direction suggests there's more to it than just the Animator component.  Please PM me your Managers and Player character (with animation/model) as a .unitypackage file.
  • edited March 2016
    Here is a video of the issue I had also. I turned on everything I thought I could for debugging.



    If you look at mark 0:07, you will see that it hits a part of the navmesh, then no matter where I click, he starts to walk backwards and it's like ignoring where I click.

    Lastly, ExitTime are unchecked on all animations for him ( there are only two, idle and walk )

    I also have root motion turned on which I had on previous versions of AC with no issues as well. I can say it seemed to be fine in 1.46g

    Thanks!


  • Unitypackage has been sent!
  • In both cases, the issue is that the Root motion-based character is not moving forward as they should be.  When root motion is enabled, AC holds off on any movement-handling itself, because that's assumed to be baked in to the animation.  As the movement speed parameter is correct (you can tell because the walk animation itself is playing), but the character is not moving, it's hard not to assume this as a bug with Unity itself.

    But!  There are some things you can do to improve motion when root motion is involved, in order of complexity:
    • Make sure your Root motion turning slider is zero if you are not using turn animations that specifically rely on root motion.  When this value is non-zero, AC will assume the animation is handling the turning (just as it does with movement) and so won't do the turning itself.
    • Enabling Turn before walking? gives better results as the character will stop and turn to move, reducing the likelihood of moving off the NavMesh or overshooting.
    • Reducing the transition time between Idle/Walk and Walk/Run animations helps to keep the controller reactive to changing states.  This reduces the chance of overshooting.  Alternatively:
    • Use Blend trees to control the Idle/Walk/Run transitions when using Root motion.  Without Root motion, AC controls the movement speed and performs smoothing / acceleration / deceleration to keep characters on track.  With Root motion, movement speed is controlled by the animation speed - so unless you use Blend trees, the movement speed can only ever be zero, or the fixed speeds determined by your walk/run animations.  Blend trees allow you to scale the animation speed with the value of the "Movement speed" float parameter - allowing for scaled movement speeds in turn.
    • If you have the budget, you can also look into relying on a dedidated third-party asset for movement.  A tutorial for linking AC with the popular Motion Controller asset, for example, can be found here.
    On a side note, I'm considering making an update to the 3D Demo to make use of the various features Unity has introduced since the first release.  One of these would be an updated Brain character that relies on Root motion, which would demonstrate how the best results with AC alone can be achieved.
  • Thanks for your help! I'll give these a try and see if I can get it working smoothly.
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.