0 votes

all tutorials say just do velocity=rootmotion.origin/delta and apply it, but it's completely wrong:

delta is physics delta and animationtree is in process, so it has it's own delta. Animation is not related to physics at all, and root motion transform is single frame change, so using it in physics_process is wrong.

All these examples work great in their completely empty projects where FPS is higher than physics FPS, however if it is otherwise, you'll see that the lower your FPS, they higher wrongness of this logic is, at physics FPS at 120 (I have to use it for physics based game) and actual 40 render FPS, root motion kinematic body logic is 3 TIMES as wrong, single character step makes them fly forward and stuf

So is there anyone who can explain how to actually use rootmotion to move kinematic body?

in Engine by (129 points)

1 Answer

0 votes

Indeed you are right. I think by dividing the delta, we do not want to 'annihilate' the Physics delta but the "Animation process time" delta.

For me this works with a higher physics step and lower FPS and vice-versa:

$AnimationTree.get_root_motion_transform().origin.z / self.get_process_delta_time()
by (31 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.