IsFirstPersonCamera: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|Switches the player camera between 1st and 3rd person.}} {{FuncSyntax|IsFirstPersonCamera()}} {{FuncParameters}} {{FuncNoPara..."
(No difference)

Revision as of 16:11, 20 October 2019

IsFirstPersonCamera

Type: Function
Context: Client
Introduced: v1.0

Description

Switches the player camera between 1st and 3rd person.

Syntax

IsFirstPersonCamera()

Parameters

  • This function has no parameters.

Return Value

  • Returns true if the 1st person mode/camera is enabled.

Example

local bFirstPerson = false
function OnKeyPress(key)
	if key == "P" then
		bFirstPerson = not bFirstPerson
		EnableFirstPersonCamera(bFirstPerson)
	end
end
AddEvent("OnKeyPress", OnKeyPress)

See also

EnableFirstPersonCamera