CameraSubject (Property): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
m Text replacement - "</code>" to "</SyntaxHighlight>"
Tags: mobile web edit mobile edit
m Text replacement - "<code lua>" to "<SyntaxHighlight code="lua">"
Tags: mobile web edit mobile edit
Line 8: Line 8:




{{Example|In a LocalScript inside the player's character or player's PlayerGui we can do<br/><code lua>
{{Example|In a LocalScript inside the player's character or player's PlayerGui we can do<br/><SyntaxHighlight code="lua">
game.Workspace.CurrentCamera.CameraSubject = game.Workspace.Part
game.Workspace.CurrentCamera.CameraSubject = game.Workspace.Part
</SyntaxHighlight>
</SyntaxHighlight>
Line 14: Line 14:
Makes the player's camera point towards 'Part'.
Makes the player's camera point towards 'Part'.


<code lua>
<SyntaxHighlight code="lua">
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
</SyntaxHighlight>
</SyntaxHighlight>

Revision as of 03:59, 27 April 2023

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