Camera::setFarClip
JavaScript
This function sets the far clip distance for a camera in the game. The far clip distance determines how far the camera can render objects; increasing this value allows the camera to display objects at greater distances. This is especially useful for enhancing visibility in larger scenes.
Syntax
camera.setFarClip(farClip);
Required Arguments
- farClip: float
Return value
- Undefined
Example
// Create a camera at a specific position and rotation
let camera = mp.cameras.new("default", new mp.Vector3(0, 0, 0), new mp.Vector3(0, 0, 0), 70);
// Set the far clip distance for the camera
const farClipDistance = 1000.0; // Example distance in units
camera.setFarClip(farClipDistance);
// Render the camera
camera.setActive(true);
mp.game.cam.renderScriptCams(true, false, 0, true, false);