- What do you want to achieve? Keep it simple and clear!
This is a Camera system that when you touch a part your camera switches to a different part of the room/set. (See video for a clearer example)
- What is the issue? Include screenshots / videos if possible!
This is yet another system that already works, but for some reason keeps applying to everyone when It’s supposed to be Local. When I test it with more than 1 player, for some reason the Camera view that’s supposed to apply to one player shows to everyone, and then everyone is fighting with the system to see where they are going.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I haven’t been able to find any solutions on the Developer Hub. This used to work fully on a Local Script in StarterPlayerScripts then changed it to a RemoteEvent that operated from the server, then fired in the same LocalScript. Still doesn’t work.
The following is the code for the script, and also how I’m running the event:
Server Script:
Remotes.FireCamera.OnServerEvent:Connect(function(Player)
for i, v in pairs(Configuration.CameraParts:GetDescendants()) do
local Cameras = Configuration.CameraParts.Cameras
if v:IsA("Part") then
v.Touched:Connect(function()
if v.Name == "LivingRoomFront" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.LivingRoomFront.CFrame)
elseif v.Name == "LivingRoomSide" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.LivingRoomSide.CFrame)
elseif v.Name == "KitchenFront" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.KitchenFront.CFrame)
elseif v.Name == "BedroomFront" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.BedroomFront.CFrame)
elseif v.Name == "BackyardFront" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.BackyardFront.CFrame)
elseif v.Name == "UpstairsBedroomFront" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.UpstairsBedroomFront.CFrame)
elseif v.Name == "LivingRoomSide2" then
Remotes.SetCurrentCamera:FireClient(Player, Cameras.LivingRoomSide2.CFrame)
end
end)
end
end
end)
Local Script:
Remotes.FireCamera:FireServer(Player)
Example of what the camera is supposed to do:
Any help with this will be appreciated.