getNearClipDistance | Multi Theft Auto: Wiki Skip to content

getNearClipDistance

Client-side
Server-side
Shared

Manual Review Required

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


This function gets the distance from the camera at which the world starts rendering. For more information about this please refer to setNearClipDistance.

Syntax

float getNearClipDistance ( )

Returns

  • float: value

This function returns a float containing the actual near clip distance.

Code Examples

shared

This example adds a/testmynearclipdistancecommand which outputs different things deppending of the current near clip distance.

local function tellPlayerNearClipFacts()
local nearClipDistance = getNearClipDistance()
outputChatBox(nearClipDistance == 0.3 and "Your near clip distance is normal." or (nearClipDistance > 0.3 and "Be aware! You shouldn't be able to see very near objects so well!" or "You should be able to see very near objects so well!"))
end
addCommandHandler("testmynearclipdistance", tellPlayerNearClipFacts)

See Also

World Functions