Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to fix this? It wont change cameraSubject

local Camera = game.Workspace.CurrentCamera

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		if string.sub(msg,1,10) == Prefix.."spectate " then
			Camera.CameraSubject = game.Players:FindFirstChild(string.sub(msg,11)).Character.Humanoid
		end
	end)
end)

2 answers

try

Camera.CameraSubject = Enum.CameraSubject. --type what you want the camera subject to be after the . 

7 comments

0

if this does not work then on line 1 put local Camera = workspace.CurrentCamera

0

might be same thing but worth a try roblox studio is like the buggiest thing in the world

0

When i try to put enum.camerasubject it doesnt appear

0

what doesn't appear? Please be more specific

0

CameraSubject Is not a enum

0

dam your right... But i just tried out your script and it says in the output "index nil with Character"

0

never mind i fixed that sorry i dont know

Cameras can be changed by a local script, NOT a server script. So, if you want to change the CameraSubject, you have to do it in a local script.

Also, you can change the CameraSubject to a player's character model instead of a player's humanoid. Like this:

local cam = workspace.CurrentCamera
cam.CameraSubject = game.Players.LocalPlayer.Character

This discussion is preserved as it was. New answers, comments, and votes are closed.