Help with making a Spectate System, but a part

If you don’t understand the title, basically I want to make a spectate system but instead of spectating a player, you spectate a part.

I have tried to use camera manipulation but I don’t know how to use it when you press a gui and disable it when you press the gui again.

1 Like

Put

--For this script, this looks like a camera
Camera.CameraType = Enum.CameraType.Attach
Camera.CameraSubject = PART

Into your script

--For this script, this looks like a 360 degrees camera
Camera.CameraType = Enum.CameraType.Follow
Camera.CameraSubject = PART

I still recommend this one

--This will follow the target but do not rotate automatically 
Camera.CameraType = Enum.CameraType.Track
Camera.CameraSubject = PART
1 Like
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local gui = script.Parent
local frame = gui:WaitForChild("Frame")
local button = frame:WaitForChild("TextButton")

local camera = workspace.CurrentCamera
local part = workspace:WaitForChild("Part")

local toggle = false

button.MouseButton1Click:Connect(function()
	toggle = not toggle
	camera.CameraSubject = if toggle then part else humanoid
end)

This is a local script which would go inside a ScreenGui instance.

Model file:
repro.rbxm (4.8 KB)

2 Likes

What is the default camera subject?

Uh i don’t really understand what did you meant but default camera subject is nothing

So, do I set it to nil? Btw, I need 3x10 chars.

Yes, nil = nothing if i was right, I also need 3x10 chars