Class MecanimBridge Extends VersionedMonoBehaviour

Public

Example of how to use Mecanim with the included movement scripts.

This script will use Mecanim to apply root motion to move the character instead of allowing the movement script to do the movement.

It assumes that the Mecanim controller uses 3 input variables

  • InputMagnitude which is simply 1 when the character should be moving and 0 when it should stop.

  • X which is component of the desired movement direction along the left/right axis.

  • Y which is component of the desired movement direction along the forward/backward axis.

It works with AIPath and RichAI.

Public Variables

velocitySmoothing
Public

Private/Protected Members

Awake ()
Protected
CalculateBlendPoint ()

Calculate position of the currently grounded foot.

Private
OnAnimatorMove ()
Private
OnUpgradeSerializedData (migrations, unityThread)

Handle serialization backwards compatibility.

Protected
Reset ()

Handle serialization backwards compatibility.

Protected
RotatePointAround (point, around, rotation)
Private Static
RotateTowards (direction, maxDegrees)

Calculates a rotation closer to the desired direction.

Protected
Update ()

Update is called once per frame.

Private
UpgradeSerializedData (isUnityThread)
Protected
ai

Cached reference to the movement script.

Private
anim

Cached Animator component.

Private
footTransforms

Cached reference to the left and right feet.

Private
prevFootPos

Position of the left and right feet during the previous frame.

Private
smoothedVelocity
Private
tr

Cached Transform component.

Private