AddCamSplineNode
DocsAddCamSplineNode(camera, x, y, z, xRot, yRot, zRot, length, p8, transitionType)Description
I filled p1-p6 (the floats) as they are as other natives with 6 floats in a row are similar and I see no other method. So if a test from anyone proves them wrong please correct.
p7 (length) determines the length of the spline, affects camera path and duration of transition between previous node and this one
p8 big values ~100 will slow down the camera movement before reaching this node
p9 != 0 seems to override the rotation/pitch (bool?)
Parameters
| Name | Type | Description |
|---|---|---|
camera | Cam | — |
x | float | — |
y | float | — |
z | float | — |
xRot | float | — |
yRot | float | — |
zRot | float | — |
length | int | — |
p8 | int | — |
transitionType | int | — |
Quick Snippet: Get CoordinatesxyzxRot
xyzxRotAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Quick Snippet: Scripted Cameracamera
cameraUse this to create and control a scripted camera for this native.
-- Create a scripted camera at the player's position
local coords = GetEntityCoords(PlayerPedId())
local cam = CreateCam("DEFAULT_SCRIPTED_CAMERA", true)
SetCamCoord(cam, coords.x, coords.y, coords.z + 2.0)
SetCamRot(cam, -15.0, 0.0, GetEntityHeading(PlayerPedId()))
SetCamFov(cam, 70.0)
SetCamActive(cam, true)
RenderScriptCams(true, true, 500, true, true)
-- Restore gameplay camera:
-- RenderScriptCams(false, true, 500, true, true)
-- DestroyCam(cam, true)Returns
voidThis native does not return a value.