Exported freecam functions.
Examples assume you are referencing the freecam exports as such:
local Freecam = exports['fivem-freecam'] Freecam:SetActive(true)
- IsActive
- IsFrozen
- GetFov
- GetPosition
- GetRotation
- GetMatrix
- GetTarget
- GetPitch
- GetRoll
- GetYaw
- GetCameraSetting
- GetKeyboardSetting
- GetGamepadSetting
- GetKeyboardControl
- SetActive
- SetFrozen
- SetFov
- SetPosition
- SetRotation
- SetCameraSetting
- SetKeyboardSetting
- SetGamepadSetting
- SetKeyboardControl
- SetGamepadControl
Returns wether the freecam is currently active or not.
bool isActive = Freecam:IsActive()
Enters or exits the freecam.
void Freecam:SetActive(bool active)
Returns wether the freecam position is currently frozen.
bool isFrozen = Freecam:IsFrozen()
Sets the freecam frozen. When frozen, controls do not update the position or rotation anymore but SetPosition/SetRotation will.
void Freecam:SetFrozen(bool frozen)
Returns the field of view of the freecam.
float fov = Freecam:GetFov()
Sets the current field of view of the freecam. This does NOT update the default FOV for the freecam. Use SetCameraSetting for that.
void Freecam:SetFov(float fov)
Returns the current position of the freecam.
vector3 position = Freecam:GetPosition()
Sets a new position for the freecam.
void Freecam:SetPosition(float posX, float posY, float posZ)
Returns the current rotation of the freecam.
vector3 rotation = Freecam:GetRotation()
Sets a new position for the freecam.
void Freecam:SetRotation(float rotX, float rotY, float rotZ)
Returns the current view matrix of the freecam.
vector3 vecX, vector3 vecY, vector3 vecZ, vector3 pos = Freecam:GetMatrix()
Returns the position the freecam is looking at from the given distance.
vector3 target = Freecam:GetTarget(float distance)
Returns the current pitch (rotX) of the freecam.
float pitch = Freecam:GetPitch()
Returns the current roll (rotY) of the freecam.
float roll = Freecam:GetRoll()
Returns the current yaw (rotZ) of the freecam.
float yaw = Freecam:GetYaw()
Returns the value of a camera setting. See CONFIGURING for details.
mixed value = Freecam:GetCameraSetting(string key)
Sets the value of a camera setting. See CONFIGURING for details.
void Freecam:SetCameraSetting(string key, mixed value)
Returns the value of a keyboard setting. See CONFIGURING for details.
mixed value = Freecam:GetKeyboardSetting(string key)
Sets the value of a keyboard setting. See CONFIGURING for details.
void Freecam:SetKeyboardSetting(string key, mixed value)
Returns the value of a gamepad setting. See CONFIGURING for details.
mixed value = Freecam:GetGamepadSetting(string key)
Sets the value of a gamepad setting. See CONFIGURING for details.
void Freecam:SetGamepadSetting(string key, mixed value)
Returns the value of a keyboard control. See CONFIGURING for details.
mixed value = Freecam:GetKeyboardControl(string key)
Sets the value of a keyboard control. See CONFIGURING for details.
void Freecam:SetKeyboardControl(string key, int value)
void Freecam:SetKeyboardControl(string key, table value)
Returns the value of a gamepad control. See CONFIGURING for details.
mixed value = Freecam:GetGamepadControl(string key)
Sets the value of a gamepad control. See CONFIGURING for details.
void Freecam:SetGamepadControl(string key, int value)
void Freecam:SetGamepadControl(string key, table value)