From bc90461bbed0be03f0b1524c202a03e8403974a2 Mon Sep 17 00:00:00 2001 From: VirxEC Date: Sun, 11 Jun 2023 02:33:55 -0400 Subject: [PATCH] Don't enable dribble cam in-air --- src/udp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/udp.rs b/src/udp.rs index 978f3a1..60df0df 100644 --- a/src/udp.rs +++ b/src/udp.rs @@ -506,7 +506,9 @@ fn update_car( if car_id == car.id() { let camera_transform = camera_transform.as_mut(); - if ballcam.enabled && car_state.pos.distance_squared(state.ball.pos) > MIN_DIST_FROM_BALL_SQ { + if ballcam.enabled + && (!car_state.is_on_ground || car_state.pos.distance_squared(state.ball.pos) > MIN_DIST_FROM_BALL_SQ) + { let ball_pos = state.ball.pos.to_bevy(); camera_transform.translation = car_transform.translation + (car_transform.translation - ball_pos).normalize() * 300.;