So in the DoFixedUpdate() of ControlsScript.cs you'll find something along the lines of this:
// Apply Root Motion
if ((currentMove != null && currentMove.applyRootMotion)
|| applyRootMotion) {
Vector3 newPosition = transform.position;
newPosition.y += myMoveSetScript.GetDeltaPosition().y;
newPosition.x += myMoveSetScript.GetDeltaPosition().x;
transform.position = newPosition;
}else{
character.transform.localPosition = new Vector3(0, 0, 0);
}
GetDeltaPosition() is a Vector2 method in the MoveSetScript.cs
I created a new Vector3 method called GetDeltaPositionV3() which basically does the same thing only includes z-axis calls. But I needed to also create a GetDeltaPositionV3() in both MecanimControl.cs and LegacyControl.cs as well
MoveSetScript.cs:
public Vector3 GetDeltaPositionV3()
{
if (controlsScript.myInfo.animationType == AnimationType.Mecanim) {
return mecanimControl.GetDeltaPositionV3();
} else {
return legacyControl.GetDeltaPositionV3();
}
}
MecanimControl.cs:
public Vector3 GetDeltaPositionV3() {
return animator.deltaPosition;
}
LegacyControl.cs:
public Vector3 GetDeltaPositionV3()
{
Vector3 deltaPosition = transform.position - lastPosition;
lastPosition = transform.position;
return deltaPosition;
}
---
I've since changed the ControlsScript.cs DoFixedUpdate() section to the following:
// Apply Root Motion
Vector3 newPosition = transform.position;
if ((currentMove != null && currentMove.applyRootMotion)
|| applyRootMotion) {
newPosition.y += myMoveSetScript.GetDeltaPositionV3().y;
newPosition.x += myMoveSetScript.GetDeltaPositionV3().x;
newPosition.z += myMoveSetScript.GetDeltaPositionV3().z;
transform.position = newPosition;
} else {
character.transform.localPosition = new Vector3(0, 0, 0);
}
if (currentMove == null) {
newPosition.z = 0;
transform.position = newPosition;
}
I believe that's all I did.