Search Unity

Strafing Problem with Standard Assets Third Person Controller

Discussion in 'Animation' started by SolarFalcon, Oct 21, 2019.

  1. SolarFalcon

    SolarFalcon

    Joined:
    Nov 28, 2015
    Posts:
    170
    Hello.

    I'm trying to get my AI to strafe. This should be pretty simple right? Walk left/right and look at the target. I am using the Standard Assets Third Person controller with a Playmaker FSM to control the AI states.

    To make a long story short, I have a simple script that sets the NavMeshAgent.desiredVelocity to the direction it needs to move (pretty much how Unity had it set up), and the FSM has Strafing States. When the AI reaches its target, it can strafe either way or attack. Problem is, even with the Animator applying Root motion and the strafing animations also set to loop and apply root motion, my AI does NOT move. It animates, but it doesn't update its' position. I made sure to set applyRootMotion = true and even removed all of these calls in the ThirdPersonCharacter script to see if that was the problem. There are no movement constraints on the Rigidbody, so thats not the problem either. Whats more, SOMETHING is forcing the Rigidbody useGravity to false. This is even when I've disabled all of the scripts and the FSM.

    Please help, this is seriously driving me mad.