Is there a way to smoothly reset rotation to 0,0,0 on a rigid body that is tumbling down a hill?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Macryc

I am using set rotation (0,0,0) to reset the rigid body’s rotation at runtime. This works but it’s abrupt. I also have a camera following the rigid body and when the rotation is reset in this manner there’s a flicker.

Is there a way to ease/smooth the set_rotation(0,0,0) method on a rigid body?

:bust_in_silhouette: Reply From: ATom 1
func _physics_process():
    rotation=Vector3.ZERO
:bust_in_silhouette: Reply From: JulioYagami

You can use a Tween node to interpolate rotation property.

tween.interpolate_property(self, "rotation", rotation, Vector3(), 5, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) tween.start()