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

Unable to change CameraSubject?

I am trying to get the player camera on a part so you can orbit around it with right mouse button Just as normal witha player but instead its a part. i am able to change the CameraType but not the CameraSubject.

Code: Local script inside a button

local Subject = game.Workspace.PrimaryPart
local Button = script.Parent
local Camera = workspace.CurrentCamera
local Debounce = false
local LocalPlayer = game.Players.LocalPlayer
local Character = LocalPlayer.Character
local Humanoid = Character:WaitForChild("Humanoid")


Button.MouseButton1Click:Connect(function()
	if Debounce == false then
		Debounce = true
		Camera.CameraType = Enum.CameraType.Custom
		wait()
		Camera.CameraSubject = Subject
	else
		Debounce = true
		Camera.CameraSubject = Humanoid
	end
end)

1 answer

The Camera Type Needs To Be Scriptable. I Thought It Was Without Scriptable CameraType.

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