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

Help with Camera.Subject and Camera.Type?

I made a Camera Script to where it spins around a part when you join. But I made this script that is below to when you press a gui button, the camera will be on your characters head. Does not work though. It stays spinning on the part.

script.Parent.MouseButton1Click:connect(function()
	local Player = game.Players.LocalPlayer
	local Char = Player.Character
	local Camera = game:GetService("Workspace").CurrentCamera	
	while wait() do
		
		if script.Parent.Parent.TextBox.Text == "a123" then
			Camera.CameraSubject = Char:WaitForChild("Head")
			Camera.CameraType = "Attach"
		elseif script.Parent.Parent.TextBox.Text ~= "a123" then
			Player:Kick("The code you have entered is wrong.")
		end
	end

end)

1 answer

Try attaching it to a Humanoid, not the Head. Not sure, though.

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