setNearClipDistance | Multi Theft Auto: Wiki Skip to content

setNearClipDistance

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function sets the distance from the camera at which the world starts rendering. Do not use this function unless you have a specific reason to do so, as any values can cause artifacts and flickering problems. It can be used in many ways, including: reducing Z-fighting, creating more sophisticated first person views, allowing the camera to fly closer to the ground without passing through it, etcetera.

Note

setNearClipDistance should only be used when the camera orientation is controlled by setCameraMatrix , because GTA automatically adjusts this value for the optimum setting when the camera is attached to a player. Therefore ensure resetNearClipDistance is called when returning camera control back to GTA.

Syntax

setNearClipDistance ( )

Code Examples

client

This example allows the camera to be nearer to ground level without viewing what is under it.

setNearClipDistance(0.1) -- Start rendering things three times nearer than usual to archieve the effect described above

See Also

World Functions