diff --git a/src/lib.rs b/src/lib.rs index 9378a66..db2a719 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -441,14 +441,16 @@ fn update_source_properties( if let Some(source) = handle.cast_to::().expect("Failed to cast") { if let Some(transform) = transform { let translation = transform.translation(); - source - .position() - .set(( - translation.x as f64, - translation.y as f64, - translation.z as f64, - )) - .expect("Failed to set position"); + if !translation.x.is_nan() && !translation.y.is_nan() && !translation.z.is_nan() { + source + .position() + .set(( + translation.x as f64, + translation.y as f64, + translation.z as f64, + )) + .expect("Failed to set position"); + } let distance_model = distance_model .cloned() .map(|v| *v)