setCameraClip | Multi Theft Auto: Wiki Skip to content

setCameraClip

Client-side
Server-side
Shared

Pair: getCameraClip

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.

OOP Syntax Help! I don't understand this!

Syntax

bool setCameraClip ( [ bool objects = true, bool vehicles = true ] )
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • objects (default: true): Sets if you want the camera to clip on objects.
  • vehicles (default: true): Sets if you want the camera to clip on vehicles.

Returns

  • bool: result

Always returns true.

Code Examples

client

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)