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)
