diff --git a/common/camera.go b/common/camera.go index bc1ecb11..bbc6558e 100644 --- a/common/camera.go +++ b/common/camera.go @@ -386,6 +386,10 @@ func (*EntityScroller) Remove(ecs.BasicEntity) {} // Update moves the camera to the center of the space component. // Values are automatically clamped to TrackingBounds by the camera. func (c *EntityScroller) Update(dt float32) { + if c.SpaceComponent == nil { + return + } + width, height := c.SpaceComponent.Width, c.SpaceComponent.Height pos := c.SpaceComponent.Position