SetCamera
Puts this player’s view at a point, looking at another - the client side of the game mode’s camera.
The view moves to x y z and looks at lx ly lz, gliding there from where it is over ms milliseconds (0 = a cut, at most
60000; the glide eases in and out), with the field of view fov. The player’s body stays where it is, its head shown, and their
keys still move it. It is the same camera the game mode moves with its SetPlayerCamera: the last call - this one or the mode’s -
wins. The view holds until ResetCamera.
Syntax
Section titled “Syntax”SetCamera(x, y, z, lx, ly, lz [, ms, fov])| Parameter | Type | |
|---|---|---|
x |
number | metres - where the camera stands |
y |
number | metres |
z |
number | metres |
lx |
number | metres - the point it looks at |
ly |
number | metres |
lz |
number | metres |
ms |
number | the glide from where the view is, milliseconds (0 = a cut) (optional) |
fov |
number | the field of view in degrees, 10-120 (nil = the player’s own) (optional) |
Returns
Section titled “Returns”boolean - false for a point that looks nowhere (it is the camera’s own) or before the world is up
Example
Section titled “Example”-- a slow look around the market square when the player opens the town's pagefunction OnServerEvent(name, data) if name == "town_view" then SetCamera(1290, 1070, 40, 1280, 1088, 27, 3000) end if name == "town_view_end" then ResetCamera(1500) endendSee also
Section titled “See also”ResetCamera · IsCameraSet · GetLookTarget · the The player, the level and the frame group of the index
