setCameraTarget
Client
Makes the camera follow a player or ped, as in normal play. It also undoes setCameraMatrix and attachCameraToElement.
bool setCameraTarget(player|ped target)
Parameters
| Name | Type | Description |
|---|---|---|
| target | player|ped | The player or ped. localPlayer gives the camera back to the local player. |
Returns
true if the camera now follows the target. false if it is neither a player nor a ped, or is not loaded.
Example
addCommandHandler("resetcam", function()
setCameraTarget(localPlayer)
end)