News Forums RAIN General Discussion and Troubleshooting Rotation Animation Trouble

This topic contains 1 reply, has 1 voice, and was last updated by  delphinius81 1 month, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #40455

    delphinius81
    Participant

    I have a wander behavior that I created off of some code elsewhere in these forums. I select a random location on the nav mesh, call the move behavior, and then wait for a random amount of time - rinse and repeat. My problem is that I cannot get my object’s rotation animation to play properly before moving.

    I built an animation controller that uses speed and rotation speed in a blend tree. I have set speed to 1 and rotation speed to 90 through the AI inspector.

    I have 6 animation clips in the blend tree:
    walk turn left (rotation speed -90, speed 1), walk (rotation speed 0, speed 1), walk turn right (rotation speed 90, speed 1)
    turn left (rotation speed -90, speed 0), idle (rotation speed 0, speed 0), turn right (rotation speed 90, speed 0)

    walk turn left, walk, and walk turn right all have root motion. walk turn left, turn left, walk turn right, turn right have root rotation.

    In my AI object, use root motion is checked and override root rotation is not checked.

    The Face Before Move Angle is set to 0.01, which I think means that my object should be within 0.01 degrees of the target orientation before any speed is applied.

    I would expect, then, that my turn left/right animations should play, as rotation speed is +/-90 and speed is 0. My object starts to rotate, but then freezes after either completing the animation once, or not at all. I’m guessing that since the root rotation did not get the object to the target orientation, speed is never set to 1, and nothing further happens.

    So how am I supposed to configure my behavior to properly synch my rotations and movement behavior?

    #40458

    delphinius81
    Participant

    In case other people run into a similar issue, I got around the issue by making changes to my Animation Controller. Instead of have a 2D blend tree with all 6 animations, I split the blend tree into two separate states. One blend tree handles standing still animations and the other handles moving animations. I use rotation angle as my blend parameter (instead of rotation speed as mentioned above). It was also important to enable looping on the animations, else they would play once and then stop.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.