fix walking throwing gltich
This commit is contained in:
@@ -129,7 +129,7 @@ fn on_trigger_thrown(
|
|||||||
impact_animation: explosion_animation,
|
impact_animation: explosion_animation,
|
||||||
damage: head.damage,
|
damage: head.damage,
|
||||||
},
|
},
|
||||||
Collider::sphere(0.5),
|
Collider::sphere(0.4),
|
||||||
CollisionLayers::new(
|
CollisionLayers::new(
|
||||||
LayerMask(GameLayer::Projectile.to_bits()),
|
LayerMask(GameLayer::Projectile.to_bits()),
|
||||||
LayerMask(state.target_layer.to_bits() | GameLayer::Level.to_bits()),
|
LayerMask(state.target_layer.to_bits() | GameLayer::Level.to_bits()),
|
||||||
@@ -172,7 +172,11 @@ fn shot_collision(
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
commands.entity(shot_entity).despawn();
|
if let Ok(mut entity) = commands.get_entity(shot_entity) {
|
||||||
|
entity.despawn();
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
commands.trigger(PlaySound::ThrowHit);
|
commands.trigger(PlaySound::ThrowHit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user