M MY Multiplayer: Wiki
Side
Kind

setCinematicCamera

Client

Sets the camera shots the cinematic directs during playback. It replaces the earlier shots.

bool setCinematicCamera(cinematic cinematic, table shots)

Parameters

NameTypeDescription
cinematiccinematicThe cinematic.
shotstableA list of shots, in order of start. An empty list takes the camera out of the cinematic.

Returns

true if they were applied. false if the table is invalid, with a warning saying why.

Common shot fields

Times are cinematic time, in ms. Each shot starts once the one before has stopped:

  • start: when it comes in (required).
  • blend: ms to blend from the shot before. 0 is a cut.
  • stop: when it stops. Without it, it runs until the next shot; once stopped, the camera holds its last view.
  • shake: shake in metres, 0 by default. shakeSpeed: its frequency in Hz, 12 by default.
  • letterbox: true shows SA's widescreen borders during the shot.

Path shots

A path shot defines keys (a list of keyframes in time order):

  • time: keyframe time in ms (required).
  • position and target: vec3 coordinates (required).
  • roll: roll angle in degrees (0 by default).
  • fov: field of view in degrees, above 0 and below 180 (70 by default).
  • smooth: true follows SA's cutscene curve; false goes straight to the next key.
  • ease: easing to the next key — "linear" (default), "inQuad", "outQuad", "inOutQuad", "inCubic", "outCubic" or "inOutCubic".

Actor-following shots

A shot that follows an actor defines:

  • actor: the actor's name (required).
  • offset: camera offset as a vec3 in the actor's space (required).
  • Aim target: lookAt (a vec3 in the actor's space), lookAtActor (another actor's name) or lookAtBone (a ped's bone).
  • roll and fov: optional roll and field of view in degrees.

Example

local intro = createCinematic("cinematics/intro.cine")
setCinematicCamera(intro, {
    {
        start = 0,
        letterbox = true,
        keys = {
            { time = 0, position = vec3(2480, -1700, 30), target = vec3(2495, -1680, 14) },
            { time = 6000, position = vec3(2500, -1700, 20), target = vec3(2495, -1680, 14), ease = "inOutQuad" },
        },
    },
    { start = 6000, blend = 1000, actor = "hero", offset = vec3(0, -4, 1.5), lookAtActor = "hero" },
})

See also