Root motion implementation#24201
Conversation
70ddfd8 to
8b7f259
Compare
| match self { | ||
| Self::Translation | Self::TranslationAndRotation => true, | ||
| } |
There was a problem hiding this comment.
Seems like it would always be true here, maybe the match is not needed?
There was a problem hiding this comment.
Yes it's always true. I put the match in case we add more modes in the future so we don't forget to change here. I think it will be optimize by the compiler anyway. But I can replace it with just a true if you think it's not useful.
Co-authored-by: François Mockers <francois.mockers@vleue.com>
Co-authored-by: François Mockers <francois.mockers@vleue.com>
There was a problem hiding this comment.
Note for someone to check if this asset is allowed to be committed or if it needs to be a remote/web asset.
There was a problem hiding this comment.
Is this because of potential copyright or licensing issues with the model, or is it just to avoid overloading the repository? If it’s a licensing issue, please note that this is simply the existing fox model to which I’ve added root motion to the running animation.
There was a problem hiding this comment.
It’s to do with repo size / bloat. E.g., see #23567 (comment)
I don’t know the bytes threshold but AFAIK, I think bevy wants to avoid putting more assets in this repo if possible.
|
I realized that removing the |
Objective
Closes: #23355
Final step for the root motion implementation !
Solution
Add the
RootMotioncomponent that stores the informations about the root motion for the current frame:Add the
RootMotionModeto control how theRootMotionis extracted. There are 2 modes, one with only translation and one with translation and rotation :Add the field
root_motion_targetandroot_motion_modeto theAnimationPlayer:Testing
The
test_root_motiontests the extraction of the root motion in a configuration with 2 blended clips. The test is done once with the clips running forward and once backward.Showcase
You can run the
root_motionexample to see it in action.