SetFarClipDistance: Difference between revisions
Jump to navigation
Jump to search
m →Example |
No edit summary |
||
| (16 intermediate revisions by 6 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function is used to set the distance of render. | This function is used to set the distance of render. Areas beyond the specified distance will not be rendered. | ||
[[File:Far.png|thumb|example for function]] | |||
==Syntax== | ==Syntax== | ||
| Line 10: | Line 10: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''distance:''' A float specifying the distance of render. | *'''distance:''' A float specifying the distance of render. '''Setting this less than 5 will cause problems to the client.''' | ||
===Returns=== | ===Returns=== | ||
| Line 17: | Line 17: | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | <section name="Server" class="server" show="true"> | ||
This example adjusts the visibility range of the game world. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | addEventHandler("onResourceStart", resourceRoot, | ||
setFarClipDistance(3000) -- | function() | ||
end addEventHandler(" | setFarClipDistance(3000) -- We adjust visibility range to 3000 metres | ||
end | |||
) | |||
</syntaxhighlight> | |||
</section> | |||
<section name="Client" class="client" show="true"> | |||
This example adjusts the visibility range of the game world. | |||
<syntaxhighlight lang="lua"> | |||
addEventHandler("onClientResourceStart", resourceRoot, | |||
function() | |||
setFarClipDistance(3000) -- We adjust visibility range to 3000 metres | |||
end | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
| Line 27: | Line 39: | ||
==See Also== | ==See Also== | ||
{{World functions}} | {{World functions}} | ||
Latest revision as of 00:29, 6 October 2026
This function is used to set the distance of render. Areas beyond the specified distance will not be rendered.

Syntax
bool setFarClipDistance ( float distance )
Required Arguments
- distance: A float specifying the distance of render. Setting this less than 5 will cause problems to the client.
Returns
Returns true if the distance was set correctly, false if invalid arguments were passed.
Example
Click to collapse [-]
ServerThis example adjusts the visibility range of the game world.
addEventHandler("onResourceStart", resourceRoot,
function()
setFarClipDistance(3000) -- We adjust visibility range to 3000 metres
end
)
Click to collapse [-]
ClientThis example adjusts the visibility range of the game world.
addEventHandler("onClientResourceStart", resourceRoot,
function()
setFarClipDistance(3000) -- We adjust visibility range to 3000 metres
end
)
See Also
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight