import GameLogic con = GameLogic.getCurrentController() cam = con.getOwner() key_r = con.getSensor('r_key') if key_r.isPositive(): cam.lens = 80.0 else: cam.lens = 35.0