Rigidbody 3D Movement Is Slow And Inconsistent

Godot Version

4.4.stable

Question

I’ve been trying to convert my NPCs from using CharacterBody3D Nodes to Rigidbody3D for performance reasons (move_and_slide overhead with multiple entities). I’m using the same calculations for the desired velocity for both the CharacterBody3D and the Rigidbody3D, just changed how it’s applied to the NPC (apply_force/setting linear_velocity vs move_and_slide).

For some reason, using the Rigidbody3D makes the movement slower and inconsistent. I already change linear damping mode to Replace and made the global damping 0.0. Rigidbody’s mass is the minimum value, no Physics material with friction, gravity scale is 0.0, tried with both apply_force, apply_impulse, setting the linear_velocity, tried multiple values and they either move too slowly, or at breakneck speeds that eventually crash the game.

Above is the new attempt using RigidBody3D.linear_velocity = desired_velocity

And this one is the old one with CharacterBody3D.velocity = desired_velocity and then CharacterBody3D.move_and_slide()

Ok, part of the problem was a variable I had unknowingly changed during testing that actually changed the velocity between tests, and that made the difference so huge.

But still after changing it, there’s a perceptible difference between using move_and_slide and the RigidBody. Still can’t figure out why, though.

I’m using global_position += velocity * delta for the time being, since it produces the most accurate visual results, even if collisions appear to be weird, need to test a bit more.