Camera::setCoord: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
 
Line 8: Line 8:
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
{{JSContainer|
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
//Set camera coords to local player position
let {x, y, z} = mp.players.local.position;
let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40);
camera.setCoord(x, y, z);
 
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Camera_definition_c}}
{{Camera_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 19:43, 14 September 2021

Sets the position of the camera.

Syntax

camera.setCoord(posX, posY, posZ);

Required Arguments

  • posX: float
  • posY: float
  • posZ: float

Return value

  • Undefined

JavaScript Syntax

Example

//Set camera coords to local player position
let {x, y, z} = mp.players.local.position;
let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40);
camera.setCoord(x, y, z);


See also