SetCameraClip: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(remove outdated info) |
||
(11 intermediate revisions by 8 users not shown) | |||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
This function sets if the camera will "collide" with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that. | This function sets if the camera will "collide" with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setCameraClip ( bool objects, bool vehicles ) | bool setCameraClip ( [ bool objects = true, bool vehicles = true ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Camera]].setClip||getCameraClip}} | |||
=== | ===Optional Arguments=== | ||
*'''objects:''' Sets if you want the camera to clip on objects. | *'''objects:''' Sets if you want the camera to clip on objects. | ||
*'''vehicles:''' Sets if you want the camera to clip on vehicles. | *'''vehicles:''' Sets if you want the camera to clip on vehicles. | ||
Line 18: | Line 17: | ||
==Example== | ==Example== | ||
This function enables it to look through cars | |||
This function enables it to look | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function enableCameraThoughCars () | function enableCameraThoughCars () | ||
Line 25: | Line 23: | ||
outputChatBox ("Your camera can see the vehicle interior now!",255,0,0,false) | outputChatBox ("Your camera can see the vehicle interior now!",255,0,0,false) | ||
end | end | ||
addEventHandler ("onClientResourceStart", | addEventHandler ("onClientResourceStart",resourceRoot,enableCameraThoughCars) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Client camera functions}} | {{Client camera functions}} | ||
[[hu:setCameraClip]] | |||
[[RO:setCameraClip]] |
Latest revision as of 06:20, 20 January 2022
This function sets if the camera will "collide" with any objects or vehicles in its way. This means that if object clip is enabled an object is in the way of where the camera actually wants to be, the camera will try to be in front of it. This function can disable that.
Syntax
bool setCameraClip ( [ bool objects = true, bool vehicles = true ] )
OOP Syntax Help! I don't understand this!
- Method: Camera.setClip(...)
- Counterpart: getCameraClip
Optional Arguments
- objects: Sets if you want the camera to clip on objects.
- vehicles: Sets if you want the camera to clip on vehicles.
Returns
Always returns true.
Example
This function enables it to look through cars
function enableCameraThoughCars () setCameraClip (true,false) outputChatBox ("Your camera can see the vehicle interior now!",255,0,0,false) end addEventHandler ("onClientResourceStart",resourceRoot,enableCameraThoughCars)