fix walking throwing gltich

This commit is contained in:
2025-04-29 22:19:56 +02:00
parent 34ac340399
commit f6eb652fd2

View File

@@ -129,7 +129,7 @@ fn on_trigger_thrown(
impact_animation: explosion_animation,
damage: head.damage,
},
Collider::sphere(0.5),
Collider::sphere(0.4),
CollisionLayers::new(
LayerMask(GameLayer::Projectile.to_bits()),
LayerMask(state.target_layer.to_bits() | GameLayer::Level.to_bits()),
@@ -172,7 +172,11 @@ fn shot_collision(
continue;
};
commands.entity(shot_entity).despawn();
if let Ok(mut entity) = commands.get_entity(shot_entity) {
entity.despawn();
} else {
continue;
}
commands.trigger(PlaySound::ThrowHit);