For some reason, trying to create a pause function with a modal layout causes some timing problems, like with a turret as seen here. If you try pausing repeatedly, you'll notice the timing of the shooting changes than when it's just running normally.