I am trying to set the camera subject to a part in workspace, however it isn’t working at all.
Relevant parts of the server script:
local Orb = game:GetService("ServerStorage"):WaitForChild("Storage"):WaitForChild("VitalisSummon")
local orb = Orb:Clone()
orb.Parent = workspace
game.ReplicatedStorage.Events.SummonCamera:FireClient(vitalis, "on", orb) -- vitalis = player, "on" = status, orb = the part
wait(5)
game.ReplicatedStorage.Events.SummonCamera:FireClient(vitalis, "off")
Local Script:
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("SummonCamera").OnClientEvent:Connect(function(status, object)
print(status) -- this will print "on" when i fire the event
print(object.Parent.Name) -- this always errors, i tried object.Name and it said nil, this also says nil.
if status == "on" then
camera.CameraType = Enum.CameraType.Follow -- the camera type DOES change
camera.CameraSubject = object -- it just does not set the subject to the object.
else
camera.CameraType = Enum.CameraType.Custom -- this works when i fire the "off" status
camera.CameraSubject = player.Character.Humanoid -- this works when i fire the "off" status
end
end)
The object DOES exist, and its parented to workspace, and it’s being fired through the event, so I don’t know why its not being picked up…?