Fix crash

This commit is contained in:
Joshua Barretto 2023-05-26 23:52:41 +01:00
parent a01739af20
commit a2253b7a33

View File

@ -85,7 +85,7 @@ impl<'a> System<'a> for Sys {
let strength = pull_factor * 50000.0;
let pull_dir = (leader_pos.0 - follower_pos.0)
.try_normalized()
.unwrap_or_default();
.unwrap_or(Vec3::unit_y());
let impulse = pull_dir * strength * dt.0;
// Can't fail