def stopball(): pos = ball.getPosition() if pos[2] > 10: ball.disable(viz.PHYSICS) vizact.ontimer(0,stopball)