CameraMode (Property): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Legend26
Redundant sections
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
 
(4 intermediate revisions by 2 users not shown)
Line 9: Line 9:
==Example==
==Example==
This code, put in a {{type|instance=LocalScript}}, would lock the camera of the player it is running for to [[first person]].
This code, put in a {{type|instance=LocalScript}}, would lock the camera of the player it is running for to [[first person]].
<code lua>
<syntaxhighlight lang="lua">
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
</code>
</syntaxhighlight>


[[Category:Properties]]
[[Category:Properties]]

Latest revision as of 05:04, 27 April 2023

Local: This item should be used with a LocalScript in order to work as expected in online mode.
CameraMode
Type CameraMode
Description Changes mode of camera - either first/third person or first person only
Member of Player

Example

This code, put in a LocalScript, would lock the camera of the player it is running for to first person.

game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

External links