From a019e8b5c7a60346884eed4e2329c12967466a7d Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 7 Jun 2022 09:14:11 -0500 Subject: [PATCH] Add `GlobalTransform` to map colliders. --- src/map.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/map.rs b/src/map.rs index 9891303..e6ff86d 100644 --- a/src/map.rs +++ b/src/map.rs @@ -242,6 +242,7 @@ fn spawn_colliders( .spawn() .insert(Collider::cuboid(0.5, 0.5)) .insert(Transform::from_xyz(x as f32 + 0.5, y as f32 + 0.5, 0.)) + .insert(GlobalTransform::default()) .insert(MapObstruction) .id(); if tile.blocks_visibility() { @@ -326,6 +327,7 @@ fn spawn_colliders( .spawn() .insert(Collider::cuboid(half_width, half_height)) .insert(Transform::from_xyz(center.x(), center.y(), 0.)) + .insert(GlobalTransform::default()) .insert(MapObstruction) .id(); if map.at(x as usize, y as usize).blocks_visibility() { @@ -428,6 +430,7 @@ fn spawn_portal_colliders( commands .entity(portal_entity) .insert(Transform::from_xyz(position.x(), position.y(), 0.)) + .insert(GlobalTransform::default()) .insert(Collider::cuboid(0.5, 0.5)) .insert(Sensor(true)) .insert(ActiveEvents::COLLISION_EVENTS);