Focus (Property): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
m (Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">")
m (Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>")
 
Line 11: Line 11:
{{Example|The following example only works in a LocalScript<br/><syntaxhighlight lang="lua">
{{Example|The following example only works in a LocalScript<br/><syntaxhighlight lang="lua">
game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.Part.Position)
game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.Part.Position)
</SyntaxHighlight><br/>The above example will set the position the camera is pointing towards to the position of the Part in Workspace.}}
</syntaxhighlight><br/>The above example will set the position the camera is pointing towards to the position of the Part in Workspace.}}


==See Also==
==See Also==

Latest revision as of 01:44, 27 April 2023

Focus
Type CFrame
Description Sets the position the Camera is pointing towards. If the CameraSubject is defined, it is set automatically to a CFrame at the position of the CameraSubject pointing towards the camera's CFrame.
Member of Camera


Example
The following example only works in a LocalScript
game.Workspace.CurrentCamera.Focus = CFrame.new(game.Workspace.Part.Position)

The above example will set the position the camera is pointing towards to the position of the Part in Workspace.


See Also