How to control step distance for root motion (Mecanim) animations?

I have become quite comfortable with the legacy animation system and will now be making my first attempt at the mecanim way of doing things.

One of my first issues while using root motion is getting a consistent step distance or overall movement speed for characters of different scales. For example, the player avatar will have slightly customizable size (scale). Also the enemy characters will have a script attached which will randomly choose a size (within a range), so that all of the enemies are not the exact same size by default. With root motion however, the larger characters have a larger step distance and therefore move faster than the smaller ones.

I would like to be able to control this, similar to how in the legacy system you can set a specific speed. For example, if I need all characters irrespective of size to move at the same speed, or the larger characters may need to move slower than the smaller ones since they are more heavy.

Apart from changing the animation speed, is there a setting in the animation properties or a way to do this via script in mecanim?

If your problem appears after resizing the objects:
You should add your original gameObjects(Avatar,…) as a child of an empty game object. Then change the size of the parent gameObject. In this way everything should work fine.

Based on my research it looks like that the only way to do the above at the moment is to set the specific animation to loop in place, and then override the root motion via script. This can also be used for other distance based animations such as jumps, dodges etc in which you need precise control over the distance traveled, or if this distance needs to change at runtime (based on stats for example). Here is the link to the documentation that covers this: Unity - Manual: Tutorial: Scripting Root Motion for "in-place" humanoid animations