NoClip
Client only. A free camera that flies through walls. In 'body' mode the player's body goes too, so others see it fly, and it lands where the flight ends. In 'camera' mode only the view moves. During a flight the game's controls are held, and with input on, W A S D, Space (up), C (down), Shift (boost), Alt (crawl) and the mouse steer it. The player does not see their own body, though others still do. Yaw is in degrees from +Y, rising to the left, and pitch is in degrees, positive up. The server decides who can fly with Player.noclipAllowed, and for others, enable() returns 'notAllowed'. Events are noclipChanged(active, reason), with the reason 'script', 'sessionOver', 'viewLost' or 'notAllowed', and noclipAllowedChanged(allowed).
noClip.enable()
NoClip.enable(options)Starts a flight. Returns 'enabled', 'alreadyActive', or 'notAllowed' if the server does not allow this player to fly. The game reports the camera a frame later. Until then, getState, getPosition and similar reads give null, while setPose, setPosition, setRotation, lookAt and focus are kept and applied in order.
noClip.disable()
NoClip.disable(options)Ends the flight.
noClip.isActive()
NoClip.isActive()Whether a flight is running.
noClip.isAllowed()
NoClip.isAllowed()Whether the server allows the local player to fly, which is true unless forbidden. While false, enable() returns 'notAllowed'. noclipAllowedChanged(allowed) fires when it changes.
noClip.getState()
NoClip.getState()The flight, as { mode, input, position, forward, right, up, yaw, pitch, speed, fov, renderedFov, aspectRatio }, or null if not flying.
noClip.getPosition()
NoClip.getPosition()The camera's position, or null if not flying.
noClip.setPosition()
NoClip.setPosition(position)Moves the camera. Right after enable(), it is kept until the game reports the camera, then applied, returning true. Returns false if not flying.
noClip.getRotation()
NoClip.getRotation(){ yaw, pitch } in degrees, or null if not flying.
noClip.setRotation()
NoClip.setRotation(rotation)Turns the camera, with parts left out keeping their value.
noClip.getForward()
NoClip.getForward()The direction the camera looks, or null if not flying.
noClip.setPose()
NoClip.setPose(position, forward)Puts the camera at a position, looking along a direction. Right after enable(), it is kept until the game reports the camera, then applied, returning true. Returns false if not flying.
noClip.lookAt()
NoClip.lookAt(point)Turns the camera to look at a point.
noClip.focus()
NoClip.focus(target, distance = 6)Puts the camera a distance in front of a target, looking at it.
noClip.getSpeed()
NoClip.getSpeed()The flying speed in m/s.
noClip.setSpeed()
NoClip.setSpeed(metresPerSecond)Sets the flying speed, 0.05 to 400 m/s.
noClip.getFov()
NoClip.getFov()The field of view in degrees, or 0 until known.
noClip.setFov()
NoClip.setFov(value)Sets the field of view, 20 to 140 degrees.
noClip.isInputEnabled()
NoClip.isInputEnabled()Whether keys and mouse steer the camera.
noClip.setInputEnabled()
NoClip.setInputEnabled(enabled)Lets the keys steer the camera, or leaves it to move().
noClip.move()
NoClip.move(input, deltaSeconds)Moves the camera one step, with input off only. Returns false if not flying or input is on.
noClip.screenLine()
NoClip.screenLine(x, y)The direction from the camera through a screen point, or null if not flying.
noClip.toScreen()
NoClip.toScreen(point)A world point's place on the screen, with x and y from -1 to 1, or null if it is behind the camera or not flying.