GetCamera: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(11 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{New items| | {{New items|3.0135|1.3.5| | ||
This function returns an [[element]] that corresponds to the game camera | This function returns an [[element]] that corresponds to the game camera | ||
}} | }} | ||
{{Note|Using attachElements with the camera and the main player can interfere with movement}} | |||
{{Note|Using setElementPosition/Rotation/Matrix on the camera element will automatically clear any target set with [[setCameraTarget]]}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 10: | Line 12: | ||
===Returns=== | ===Returns=== | ||
Returns an [[element]] that corresponds to the game camera | |||
==Example== | ==Example== | ||
This example attaches the camera to a vehicle | This example attaches (fixes) the camera to a vehicle. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
cam = getCamera() | local cam = getCamera() | ||
myVehicle = getPedOccupiedVehicle(localPlayer) | setElementPosition( cam, 0,0,0 ) -- Clear camera target | ||
local myVehicle = getPedOccupiedVehicle(localPlayer) | |||
attachElements( cam, myVehicle, 0,-4,2, -20,0,0 ) | attachElements( cam, myVehicle, 0,-4,2, -20,0,0 ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[hu:getCamera]] | |||
[[ar:getCamera]] | |||
[[RO:getCamera]] | |||
==See Also== | ==See Also== | ||
{{Client camera functions}} | {{Client camera functions}} |
Latest revision as of 21:57, 9 October 2020
This function returns an element that corresponds to the game camera
Syntax
element getCamera ()
Returns
Returns an element that corresponds to the game camera
Example
This example attaches (fixes) the camera to a vehicle.
local cam = getCamera() setElementPosition( cam, 0,0,0 ) -- Clear camera target local myVehicle = getPedOccupiedVehicle(localPlayer) attachElements( cam, myVehicle, 0,-4,2, -20,0,0 )
See Also
- getCamera
- getCameraClip
- getCameraFieldOfView
- getCameraGoggleEffect
- getCameraViewMode
- setCameraClip
- setCameraFieldOfView
- setCameraGoggleEffect
- setCameraViewMode
- Shared
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget