Not sure how to properly move RigidBody3Ds without being flinged in Jolt Physics

Godot Version

4.4.1.stable

Question

every so often, i want to set a RigidBody3D transform to something else
but whenever i do, if there are other RigidBodies on top or below of it they get flinged very fast or immediately disappear
setting linear_velocity and angular_velocity to zero helped, and switching back to godot physics completely fixed it, but it has other issues and i want to use jolt physics.

here is the code:

@rpc("any_peer")
func __part_move(new_transform: Transform3D, anchor: bool):
  __delete_welds()
  linear_velocity = Vector3.ZERO
  angular_velocity = Vector3.ZERO
  transform = new_transform
  transform.basis = transform.basis.orthonormalized()
  freeze = anchor

i have also tried setting the transform in _integrate_forces, but it seemed to have no effect

You’ll need to use RigidBody3D._integrate_forces() and modify the PhysicsDirectyBodyState3D.transform that comes from the state argument not the body’s transform.

thanks, i’ll try that

it works great, but for some reason sometimes it doesnt update and stays with the same value