CameraSubject (Property)

From Legacy Roblox Wiki
Revision as of 05:38, 27 April 2023 by Realjame (talk | contribs) (Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
CameraSubject
Property Instance
Description A Model, Part, or Humanoid for the camera to look at. Setting this property will override the Focus property.
Member of Camera


Example
In a LocalScript inside the player's character or player's PlayerGui we can do
game.Workspace.CurrentCamera.CameraSubject = game.Workspace.Part

Makes the player's camera point towards 'Part'.

game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

Reverts the camera to pointing back towards the character.


See Also