diff --git a/gamecore/modules/world/camera.lua b/gamecore/modules/world/camera.lua index d70057c..3df293b 100644 --- a/gamecore/modules/world/camera.lua +++ b/gamecore/modules/world/camera.lua @@ -83,15 +83,19 @@ function CameraSystem:getViewCam(id) end function CameraSystem:attachView(id) - local cam = self:getViewCam(id) + if (id ~= nil) then + local cam = self:getViewCam(id) - cam:attach() + cam:attach() + end end function CameraSystem:detachView(id) - local cam = self:getViewCam(id) + if (id ~= nil) then + local cam = self:getViewCam(id) - cam:detach() + cam:detach() + end end return CameraSystem