-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Root motion produces inaccurate transform #40294
Comments
Hello, |
Hi @jiteshvm, I'm hopeing someone more knowledgeable than me can give some advice, as the If I were looking at this, I'd probably start with https://github.com/godotengine/godot/blob/master/scene/animation/animation_tree.cpp#L857-L858, and track how |
I also have experienced the same issue about the root motion transform not being entirely accurate, happens in 3.1.2 too. |
This can be solved by adding a 0.1 second margin before and after the animation. However, since it seemed to be working properly outside of In for now I sent a PR for the fix in #43670. |
Since the root motion is calculated additively afterwards using delta time, the current After the fix of #43670, the full length of the root motion will be played back as long as these values are |
Alright, can confirm that the behaviour is due to the fade_in property in the one shot node and its not really a bug. |
@thimenesup Can you set truly the |
If you mean setting the property as is, it works. (3.1 with code) |
It seemed a bit odd, so I looked deeper and found that there seemed to be a problem with the timing of updating the initial value. The initial value can be kept at animation_blend_tree.cpp float AnimationNodeOneShot::process(float p_time, bool p_seek) {
bool active = get_parameter(this->active);
bool prev_active = get_parameter(this->prev_active);
float time = get_parameter(this->time);
float remaining = get_parameter(this->remaining);
float time_to_restart = get_parameter(this->time_to_restart);
float fade_in = get_fadein_time(); // update
float fade_out = get_fadeout_time(); // update In |
Recently in Godot 4.0, I did some research, and it seems that the cause is that when the |
4.0 bug (regression by #53819) will be fixed by #60774. The cause of this bug is that the delta subtraction is not correctly calculating the prev_time because the clamped current time is passed when calculating the root motion. So, 3.x is fine now, but 0.1 sec fade by default might be occoring confusion. |
Godot version:
3.2.2.stable.custom_build.0fe60f842
OS/device including version:
Linux 5.7.7-arch1-1
Issue description:
I have an animation that rotates my root bone by 90 degrees.
When animated directly by the
AnimationPlayer
it rotates the object exactly 90degrees.When I add it to an
AnimationTree
and play the animation once via aOneShot
orTransition
node, the total rotation is slightly less than 90 degrees.You can see this easily if you add a
RootMotionView
.Steps to reproduce:
AnimationPlayer
OneShot
in theAnimationTree
Note that the root motion view no longer lines up with the grid after one rotation:
Minimal reproduction project:
example.zip
The text was updated successfully, but these errors were encountered: