Don't update if physics is paused.
This commit is contained in:
parent
34613bfe07
commit
f6c34057aa
|
@ -311,6 +311,7 @@ impl InputGrid for VisibilityGrid {
|
|||
|
||||
fn update_viewshed(
|
||||
mut commands: Commands,
|
||||
physics_time: Res<Time<Physics>>,
|
||||
mut viewers: Query<(
|
||||
Entity,
|
||||
&mut Viewshed,
|
||||
|
@ -321,6 +322,9 @@ fn update_viewshed(
|
|||
sensors: Query<&Sensor>,
|
||||
spatial_query: SpatialQuery,
|
||||
) {
|
||||
if physics_time.is_paused() {
|
||||
return;
|
||||
}
|
||||
for (viewer_entity, mut viewshed, mut visible_entities, viewer_transform) in &mut viewers {
|
||||
viewshed.update(
|
||||
&mut commands,
|
||||
|
|
Loading…
Reference in New Issue
Block a user