Hi,
I noticed that “RootT” (the property that controls the root motion movement of humanoids) is apparently not in world space as you can see in the following screenshot:
The cube is 3 units long. The RootT curve starts at 0,0 and ends at 1,3 so one would think it moves robo kyle exactly 3 world space units and that his toes end up exactly at the end of the cube. But as you can see, robo kyle is moved slightly more than 3 world space units.
So I’m wondering how I can calculate a RootT curve that moves exactly 3 world space units? And in what kind of space is the RootT curve stored?
Thanks for your help!
Are you manually inputting the target coordinate in the transform inspector and subsequently calculating root motion curves for the animation clip? When the animation window is in record mode any changes you make in the inspector will be recorded. That should make it a bit easier to get the exact distance translation you are looking for. Personally, I find manipulating curves in the animation window a bit difficult to maintain accuracy.
Thanks for your reply.
Yes i created the animation curve “by hand” in the animation window but only for demonstration purpose for this thread. In my project I’m generating animations by script and that’s why I need to find a way to generate a curve that moves the character exactly e.g. 3 world space units. So the key question is if there is a way to convert a worldspace distance into “RootT Space”. I searched through the docs and read the blog post about Unity`s animation system but I haven’t found an answer to this question yet…
I just want to make sure that I understand you correctly. Are you creating animation clips at runtime? Or are you creating a curve and using it for evaluation during your movement? Also, would it at all be possible to post a snippet of your code so that I could make a repro case to try to get the exact results you are and troubleshoot it.
Thanks for being so helpful. I’m creating an editor script that generates unity animation clips which can then be used during runtime. But the problem I’m facing is not that much related to my script as it can be reproduced by creating the animation clip with Unity’s animation window. The problem is that it’s not documented in which space the “RootT” curve is in as 3 in “RootT Space” applied to Robo Kyle gives you something >3 in World Space. So I need to find a way to convert between those spaces.
Attached is a Unity package that gives you the scene seen in the screenshot of my first post. After importing, please open the scene “RootTTestScene.scene”. For comfort reasons, I would suggest to switch the scene camera in 2D mode and place it as seen in my screenshot above. Select the Robo Kyle and open the Animation Window. It has the test animation already applied with a RootT curve that has [0, 0] and [1, 3] applied on the “z” curve.
Note: I had to remove the textures of robo kyle in order to reduce the size of the package so that I can use the forum’s file upload.
Please let me know if i should explain something in more detail.
3001511–223769–RootTTestPackage.unitypackage (260 KB)
The root motion is affected by the humanScale property
So that your root motion will scale with the size of your humanoid.
The root motion displacement every frame will be multilplied by the human scale
3 Likes
Thank you so much! That solves the problem 
1 Like