From ec1814f46e1fe1fb521b779cce3e612c9089b7ad Mon Sep 17 00:00:00 2001 From: "Mateo \"Kuruk\" Miccino" Date: Mon, 28 Oct 2024 08:56:01 -0300 Subject: [PATCH] fix: default rotation when the rotation is infinite --- lib/src/scene_runner/components/transform_and_parent.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/scene_runner/components/transform_and_parent.rs b/lib/src/scene_runner/components/transform_and_parent.rs index 4ada3eba8..126543da5 100644 --- a/lib/src/scene_runner/components/transform_and_parent.rs +++ b/lib/src/scene_runner/components/transform_and_parent.rs @@ -73,6 +73,10 @@ pub fn update_transform_and_parent( } } + if !transform.rotation.is_finite() { + transform.rotation = godot::prelude::Quaternion::default(); + } + node_3d.set_transform(transform.to_godot_transform_3d_without_scaled()); if transform.scale.x.is_zero_approx() { transform.scale.x = 0.00001;