-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add 2D root motion in AnimationTree #5303
Comments
I'll just leave this one here in case it may help anyone to workaround while the feature is not yet there: https://godotengine.org/qa/42831/root-motion-in-2d. At least in my simple case it worked out well enough |
This comment was marked as off-topic.
This comment was marked as off-topic.
@AccumPlus Please don't bump issues without contributing significant new information. Use the 👍 reaction button on the first post instead. |
on #1191
i added a detailed description in there, on why, that may not be such a good idea of a solution, but in case someone wants to go through that whole process they may go ahead, and read the details of potential problems that you may face. as i said in the other ticket about relative frames #1191 i think the core, and true focus, should be root motion in 2D
With that said, i am a bit new to the godot source code world so i could be saying a lot of non sense that does not fit to godot world and sorry if that is the case. but i would love to hear what more expereinced developers think about whether it would be fine to just hard code a solution for 2D similar to what was done for 3D and if not, what prevents such thing from happening? |
@MotasemZakarneh I can see there are methods like |
now, i could be just stupid, and have missed something essential, but in godot 4.3 i simply can not seem to select any root motion track 😓 in this setup of a scene |
Describe the project you are working on
A 2D game where the player fights enemies whose attacks (and their properties like hit boxes) are defined by animations
Describe the problem or limitation you are having in your project
The lack of root motion for 2d transforms means that playing a new animation resets the Node2D's position rather than letting it aggregate.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
In addition to being able to select a 3D Position track as the source of root motion, also allow value tracks that are Node2D position values to be selected. Then any animation changes to that track won't actually be applied to the Node2D directly, and will instead be exposed through the root_motion property of the AnimationTree.
Users can then apply this offset through their own scripting, either directly or through a CharacterBody2D's move_and_slide method.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The basic functionality for this already exists for 3d root motion. This will replicate that code but for 2D transforms instead.
godotengine/godot#65183 shows this working for 2D positions.
One issue is that in 3D it's more obvious how to have the user select the position AND rotation AND scale.
For 2D the best idea I have is to have them select the position track and then also implicitly look for the nearby rotation and scale tracks.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No, this cannot be easily worked around with scripting. It would require a lot of wrapping around animation playback and might not work in all edge cases.
Is there a reason why this should be core and not an add-on in the asset library?
It is a feature added to the existing AnimationTree node, changing existing method behavior. So adding it through a plugin would require recreating core functionality.
The text was updated successfully, but these errors were encountered: