getCameraTarget
Client-side
Server-side
Shared
Pair: setCameraTarget
This function returns an element that corresponds to the current target of the specified player's camera (i.e. what it is following).
OOP Syntax Help! I don't understand this!
Server OOP syntax
- Method:player:getCameraTarget(...)
- Variable: .cameraTarget
Client OOP syntax
- Method:Camera.getTarget(...)
- Variable: .target
Client Syntax
element|false getCameraTarget ( )Returns
- element|false: camera target
Returns an element of the target if the function was successful, or false if bad arguments were specified. Returns false if the camera is in Fixed mode and has no target.
Server Syntax
element|false getCameraTarget ( player thePlayer )Required Arguments
- thePlayer: The player whose camera you wish to receive the target of.
Returns
- element|false: camera target
Returns an element of the target if the function was successful, or false if bad arguments were specified. Returns false if the camera is in Fixed mode and has no target.
Code Examples
client
This example checks whether a player's camera's target is another player, and returns true or false accordingly.
function isTargetPlayer() local target = getCameraTarget() if (getElementType(target) == "player") then -- If target is a player return true -- Return true else return false -- Otherwise, return false. endendSee Also
Camera Functions
- fadeCamera
- getCamera
- getCameraClip
- getCameraDrunkLevel
- getCameraFieldOfView
- getCameraGoggleEffect
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- getCameraViewMode
- resetShakeCamera
- setCameraClip
- setCameraDrunkLevel
- setCameraFieldOfView
- setCameraGoggleEffect
- setCameraInterior
- setCameraMatrix
- setCameraTarget
- setCameraViewMode
- shakeCamera