Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Skeleton3D have a root motion #9470

Open
TokageItLab opened this issue Apr 7, 2024 · 0 comments
Open

Make the Skeleton3D have a root motion #9470

TokageItLab opened this issue Apr 7, 2024 · 0 comments

Comments

@TokageItLab
Copy link
Member

TokageItLab commented Apr 7, 2024

Describe the project you are working on

Game with 3D character model

Describe the problem or limitation you are having in your project

The root motion is difficult to use with the value obtained from the AnimationMixer and conflicts with the SkeletonModifier.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The root motion has always been in the AnimationMixer, but considering the possibility of the root bone being moved by the SkeletonModifier, it makes more sense for the Skeleton to have the root motion.

In order to correctly set the root motion from the AnimationMixer, it is necessary to take into account the result of the actual skeleton rotation and accumulator difference, as we did in the past with the godotengine/godot#72931 fix.

If the skeleton has a root motion, it should be possible to set it to a readily available value.

Also, the readily available values should be blendable, so that if you want to move the skeleton itself with a modifier in a use case like XRModifier, you can correctly set the amount of influence.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Make Skeleton3D have a readonly transform value for the root motion and a root bone specification. For the root bone calcuration, the difference from the previous frame is taken and set to the root motion. Then, the RootMotionView will be included in the Skeleton3D Editor Gizmo.

..The above will have to be experimented with to see if it works. If it doesn't work, maybe we should have a setter that is only accessible from AnimationMixer and Modifier.

Although, leave the root motion and RootMotionView of AnimationMixer for compatibility.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

Root motion is strongly tied core's Animation system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment