0 votes

Hi All. In a point-and-click setting with raycasts and navigation paths, the movement of the Kinematic Body is extremely jittery. Not all the time, but every other time. I'm using the navigation node with navigation mesh and getting simple path and turning the difference into a movement vector. I' using move_and_slide to move the kinematic body along the vector. My setup is similar to this one. (you can see jittery movement in the video)

Is there a fix to this? Something in the settings of the navi mesh perhaps?

in Engine by (389 points)

You could try to smooth out the movement using one of the following ways:

  • Implement constant friction by multiplying the velocity with a value lower than 1 every frame, and add velocity rather than setting it every frame. This is a basic way of implementing smooth movement, but it's not the most robust one (more information).
  • Use the Tween node to create smooth movement. This may not be a good idea with PhysicsBodies though.

and add velocity rather than setting it every frame.

This looks interesting. How do I do that with move_and_slide? I've already multiplied velocity by 0.9 and it does seem to have helped a little - the movement is still momentarily sporadic but not nearly as bad as it was before (and still not close to what I'm used to seeing with godot).

Use the Tween node to create smooth movement

The problem here is that you can tween between start and end positions, which looks great, but ignores the navigation path and doesn't work with collisions. The movement is silk smooth but the character gets stuck when it hits an obstacle (as opposed to 'walk around it'), also, it will happily tween itself outside of the navi mesh if that's where you click...

Please log in or register to answer this question.

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.