Forum rules - please read before posting.

How to make turning animation fit turning speed?

I am working on animations for my character, and I'd like to add in a turning animation, so that when he's turning before walking, he doesn't just turn stiffly in idle animation.

I get that I simply have to use the turn float to trigger the turning animation in my animator, but before I start creating the animation, I'd like to know if there is some specific way I have to make it, to make it fit with the turning speed of my character.

Does AC automatically adjust the frame rate of the turning animation, such that the entire animation is always played whenever my character turns before walking, or will I have to try and manually adjust the length of the turning animation to fit the turning speed (i.e. tamper with the frame rate until it fits)?

Comments

  • For what, a Mecanim character?

    The "Turn float" parameter is scaled with the "Turn speed", but smoothly - it'll move from zero to its maximum value and then back down again as it nears its target.

    How the animation relies on that is down to the way your Animator Controller is configured to rely on this parameter - AC won't affect any animation directly.

    This parameter won't be related to the maximum turning angle - just the turning speed.

    For an exactly precise animation, I suppose you'd want to have an additional float parameter that is mapped to the angle difference between the character's current rotation, and their intended rotation.  I'll see about exposing such a method in the Char script in the next update, so that a simple script can read this and apply it to the Animator each frame.
  • Sounds good, thank you @ChrisIceBox !
  • Have there been any updates on exposing this method?

    I've been trying to figure out a way for my NPC animator controller to make use of a Direction float parameter. This is so NPCs can automatically turn while walking, using a blend tree.

  • Yes - this is provided by the Char script's GetAngleDifference() function.

  • Nice, thanks. This seems to be what I'm looking for.

    Before I posted my question I did a search on the scripting manual for 'angle', but this function didn't show up. I realize now it only searches from the beginning of the string (typing 'getangle' rather than 'angle' was required).

  • Thanks for the heads-up - I'll look into that.

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.