Jump to content

2.21 New Version: Some Issues with Animations


photo

Recommended Posts

Posted

😇I have two questions. The first one is: All four of my consecutive animations have root motion. But why does the root motion return to the origin when playing the third and fourth animations? I have enabled the root motion settings.😄The second question is: After the game starts running, how can the object nodes also follow the movement coordinates of the root? Do you need me to create a code to read the corresponding movement increments and then perform the object movement? Thank you very much.

2026-04-03 02-52-38.mkv

Posted

My animation state machine is very simple. It shouldn't be a problem with the state machine. Moreover, I tried to use the same root motion animation throughout, but in all cases, the root motion ended when the third animation was playing.image.thumb.png.63434d8ae26e673f47b54609dd7e03a1.png

Posted

Hello.

To work with root motion, you need to do the following.

First, check the skeleton in the mesh and animations. For correct operation, the root joint must be located on the plane between the feet. If this is not the case, you can fix it in a third-party editor or generate an additional joint in the import settings. In my example, the root joint is mixamorig:Hips.

src_skeleton.png

In the mesh and animation import settings, enable Create Root Motion Joint. We will create it based on mixamorig:Hips. For position, we use only the X and Y coordinates. We do not extract rotation, as this suits the current animations.

import_settings.png

We get a joint like this in all skeletons:

root_motion_joint.png

Second, for animations you need to set the Root Motion Present flag. Root joint movement extraction only occurs for animations with this flag.

root_motion_present.png

Third, enable Root Motion in the graph itself. This allows you to receive the extracted displacement in code and then apply it to the object.

void PostUpdate()
{
	if (animScript.IsActiveRootMotion)
		node.WorldTransform = node.WorldTransform * animScript.RootMotionDelta.GetMat();
}

In the video you can see the result. First, the graph preview without root motion extraction, then with extraction, and finally the result of applying the displacement to the object.

 

 

root_motion_test.upackage

  • Like 2
Posted
29 minutes ago, karpych11 said:

Hello.

 

To work with root motion, you need to do the following.

 

First, check the skeleton in the mesh and animations. For correct operation, the root joint must be located on the plane between the feet. If this is not the case, you can fix it in a third-party editor or generate an additional joint in the import settings. In my example, the root joint is mixamorig:Hips.

src_skeleton.png

 

In the mesh and animation import settings, enable Create Root Motion Joint. We will create it based on mixamorig:Hips. For position, we use only the X and Y coordinates. We do not extract rotation, as this suits the current animations.

import_settings.png

 

We get a joint like this in all skeletons:

root_motion_joint.png

 

Second, for animations you need to set the Root Motion Present flag. Root joint movement extraction only occurs for animations with this flag.

root_motion_present.png

 

Third, enable Root Motion in the graph itself. This allows you to receive the extracted displacement in code and then apply it to the object.

void PostUpdate()
{
	if (animScript.IsActiveRootMotion)
		node.WorldTransform = node.WorldTransform * animScript.RootMotionDelta.GetMat();
}

 

In the video you can see the result. First, the graph preview without root motion extraction, then with extraction, and finally the result of applying the displacement to the object.

 

root_motion_test.upackage 16.34 MB · 0 downloads

Thank you for your response. I have encountered some issues here. I have tried using XY XZ YZ and also setting the rotation values, but the direction of the animation extraction is always incorrect.This is my skeleton.

UCRZX9$OU9R)EVE[EI7K4EV.png

Posted

I can temporarily correct it by modifying the rotation value of the Node.🤔

Posted

I tried multiple different animation resources. Some of them did not have this issue, while some did. The ones that did might not have good compatibility. When I used the Unity engine, it would have better compatibility. In summary, that's how it was.🤗

Posted

I also discovered some engine error issues. I frequently operated on animation resources, such as importing. Sometimes the animation resources would be damaged or misaligned. Under the same settings,

Posted

perfectsummer

Could you please share your test project with us, along with the animation assets you are using? It would also be very helpful if you could provide detailed step-by-step instructions for reproducing the incorrect rotation.

This would significantly help us investigate the root cause and speed up the fix.

Thank you!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

EJ3LM_W1@L)QZG9YKH3.thumb.png.e9e3b21a56b0775e98022e6246f00ad6.png6CSZR09P0YPXA3C)@LX.png.7d0e5646668b93133c92ae5289290efc.png艺术动画.zipThe testing method is very simple. Just edit the chart, connect the states randomly, then save. By repeating this process several times, the problem of incorrect bone rotation will occur. I tested several sets of animations and found that this issue frequently occurred. At first, it didn't happen, but after frequently saving the chart through repeated operations, it did.

Posted

I simply edited and saved several animation charts, then played them, and the bones started to rotate chaotically.

Posted

Thank you for the animations and the problem description. Unfortunately, I was unable to reproduce the object rotation issue when re-saving the animation graph multiple times. I tested with four animations that had root motion enabled. The attached video shows only a portion of my attempts, but each time the behaviour was correct. Could you provide a more detailed reproduction scenario? I also assembled a small state machine consisting of an idle animation and a series of attack animations. The test movement component also worked correctly. You can see the result in the second part of the attached video. Additionally, there is currently a limitation when configuring .anim files that are located inside an FBX/glTF/USD container. After changing the settings, you need to reimport the FBX for the changes to take effect. This could potentially be affecting the playback in your case.

 

 

root_motion_test_2.upackage

Posted

Could it be that I have encountered quantum entanglement? I'll give it another try. If I still make mistakes, I'll upload the entire recording process.😬

 

Posted

I may have identified the cause of the error. There is one setting in my import process that is different from yours.I tried to re-import all the animations and checked this option. It seemed to work fine. But when I closed it, a rotation error occurred. I'm not quite clear about the meaning of this option. Anyway, the problem seems to be here.

H6HT~ULD)H$H8EGDWPO2JLO.png

Posted (edited)

I finally figured out that there is a minor bug. Even if you forget to check it, if you check it again, the animation will become disorderedly rotating. The only way to solve this is to delete and re-import it..😆

M6M4(405LWJ2%MXF66WSBTK.png

Edited by perfectsummer
×
×
  • Create New...