Skip to content

Commit

Permalink
Don't enable dribble cam in-air
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Jun 11, 2023
1 parent b74a331 commit bc90461
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.;
Expand Down

0 comments on commit bc90461

Please sign in to comment.