<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SetCameraPos</id>
	<title>SetCameraPos - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SetCameraPos"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=SetCameraPos&amp;action=history"/>
	<updated>2026-09-19T06:22:10Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=SetCameraPos&amp;diff=814&amp;oldid=prev</id>
		<title>QCherry: Update 0.1.3 camera world placement, streaming safety and far camera test</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=SetCameraPos&amp;diff=814&amp;oldid=prev"/>
		<updated>2026-09-09T00:07:44Z</updated>

		<summary type="html">&lt;p&gt;Update 0.1.3 camera world placement, streaming safety and far camera test&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:07, 9 September 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l58&quot;&gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Server-side also accepts &amp;lt;code&amp;gt;setCameraPosition&amp;lt;/code&amp;gt;; this extra alias is not available client-side.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Server-side also accepts &amp;lt;code&amp;gt;setCameraPosition&amp;lt;/code&amp;gt;; this extra alias is not available client-side.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Only the owning resource may change an already controlled camera. Server and client ownership are distinct, even when resource names match; use one side consistently for a camera sequence.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Only the owning resource may change an already controlled camera. Server and client ownership are distinct, even when resource names match; use one side consistently for a camera sequence.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Camera positions and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;complete paths/&lt;/del&gt;orbits must &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stay &lt;/del&gt;within &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;100 &lt;/del&gt;metres &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;of &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;local character&lt;/del&gt;. Camera control does not move the character, change replication distance, freeze input, or enable remote-player spectating.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Camera positions&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, paths &lt;/ins&gt;and orbits &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;have no distance limit relative to the local character. All world coordinates &lt;/ins&gt;must &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;remain finite and &lt;/ins&gt;within &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-1,000,000 to 1,000,000 &lt;/ins&gt;metres&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;; &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;complete orbit extent is validated too&lt;/ins&gt;. Camera control does not move the character, change replication distance, freeze input, or enable remote-player spectating.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Use [[resetCameraPos]] to restore gameplay view. Resource stop, disconnect and world/character changes release camera ownership; see [[onClientCameraReset]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Use [[resetCameraPos]] to restore gameplay view. Resource stop, disconnect and world/character changes release camera ownership; see [[onClientCameraReset]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* An applied acknowledgement confirms command handling, not &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;that the resulting view has rendered&lt;/del&gt;. For a fresh read-back, request state after another frame or a short timer. See [[Scripted camera]] for lifecycle, acknowledgement and state-cache details.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* An applied acknowledgement confirms command handling, not &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rendering or completion of world streaming&lt;/ins&gt;. For a fresh read-back, request state after another frame or a short timer. See [[Scripted camera]] for &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;distant scenes, &lt;/ins&gt;lifecycle, acknowledgement and state-cache details.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Lua Functions]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Lua Functions]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Shared Functions]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Shared Functions]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Camera Functions]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Camera Functions]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=SetCameraPos&amp;diff=792&amp;oldid=prev</id>
		<title>QCherry: Document scripted camera API and events available from G1R:MP 0.1.3</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=SetCameraPos&amp;diff=792&amp;oldid=prev"/>
		<updated>2026-09-08T23:50:38Z</updated>

		<summary type="html">&lt;p&gt;Document scripted camera API and events available from G1R:MP 0.1.3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= setCameraPos =&lt;br /&gt;
&amp;lt;div style=&amp;quot;background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; font-weight:bold; letter-spacing:0.04em;&amp;quot;&amp;gt;AVAILABLE FROM UPDATE 0.1.3&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;color:#111111; margin-top:0.25rem;&amp;quot;&amp;gt;This function is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the local scripted camera&amp;#039;s world position while preserving its current rotation and FOV.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Client-side&lt;br /&gt;
number|false setCameraPos(number x, number y, number z)&lt;br /&gt;
-- Server-side&lt;br /&gt;
bool setCameraPos(int playerId, number x, number y, number z)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || yes || Server-side only: the connected player whose local camera receives the command.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || World-space X coordinate in metres; finite and within -1,000,000 to 1,000,000.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || World-space Y coordinate in metres; finite and within -1,000,000 to 1,000,000.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || yes || World-space Z coordinate in metres; finite and within -1,000,000 to 1,000,000.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Client-side:&amp;#039;&amp;#039;&amp;#039; a positive &amp;lt;code&amp;gt;requestId&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; when validation or queuing fails. Wait for [[onClientCameraCommandResult]] to learn the execution result. &amp;#039;&amp;#039;&amp;#039;Server-side:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; only means validated and queued for the connected player; &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; means rejected. A server return value is not a client acknowledgement.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Read the local camera/player state before issuing the command. The command&amp;#039;s own result arrives separately in onClientCameraCommandResult.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
-- Client-side: run after the local world and player camera are ready.&lt;br /&gt;
local query&lt;br /&gt;
addEventHandler(&amp;quot;onClientCameraCommandResult&amp;quot;, resourceRoot,&lt;br /&gt;
    function(requestId, ok, phase, errorText, stateJson)&lt;br /&gt;
        if requestId ~= query then return end&lt;br /&gt;
        query = nil&lt;br /&gt;
        if not ok or phase ~= &amp;quot;state&amp;quot; then&lt;br /&gt;
            outputDebugString(&amp;quot;Camera query failed: &amp;quot; .. tostring(errorText), 2)&lt;br /&gt;
            return&lt;br /&gt;
        end&lt;br /&gt;
        local state = getCameraState()&lt;br /&gt;
        if not state or not state.ready then return end&lt;br /&gt;
        local request = setCameraPos(state.playerX - 5, state.playerY, state.playerZ + 3)&lt;br /&gt;
        if not request then outputDebugString(&amp;quot;Camera position was not queued&amp;quot;, 2) end&lt;br /&gt;
    end)&lt;br /&gt;
query = requestCameraState()&lt;br /&gt;
if not query then outputDebugString(&amp;quot;Camera query was not queued&amp;quot;, 2) end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Available in client-side and server-side resource scripts. Equivalent PascalCase spelling: &amp;lt;code&amp;gt;SetCameraPos&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Client success phase: &amp;lt;code&amp;gt;applied&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Server-side also accepts &amp;lt;code&amp;gt;setCameraPosition&amp;lt;/code&amp;gt;; this extra alias is not available client-side.&lt;br /&gt;
* Only the owning resource may change an already controlled camera. Server and client ownership are distinct, even when resource names match; use one side consistently for a camera sequence.&lt;br /&gt;
* Camera positions and complete paths/orbits must stay within 100 metres of the local character. Camera control does not move the character, change replication distance, freeze input, or enable remote-player spectating.&lt;br /&gt;
* Use [[resetCameraPos]] to restore gameplay view. Resource stop, disconnect and world/character changes release camera ownership; see [[onClientCameraReset]].&lt;br /&gt;
* An applied acknowledgement confirms command handling, not that the resulting view has rendered. For a fresh read-back, request state after another frame or a short timer. See [[Scripted camera]] for lifecycle, acknowledgement and state-cache details.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Functions]]&lt;br /&gt;
[[Category:Shared Functions]]&lt;br /&gt;
[[Category:Camera Functions]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>