CurrentCamera not working on client, instead showing for all players

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to create a cutscene where the player is going inside the building

  2. What is the issue? Include screenshots / videos if possible!
    When testing multiplayer, the CurrentCamera affects all players

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried moving the location of the script; both in player scripts and StarterGui, I created two different scripts – none seemed to work

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Both scripts are in local scripts, the issue is in the first script, but I included the second script in case it was affecting the first script

--  
local camera = workspace.CurrentCamera
local camerathing = game.Workspace.CameraThing
local hitbox2 = game.Workspace.hitbox2
local debounce = false
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hitbox1 = game.Workspace.Hitbox

local debounce2 = false
local animation = script.Crawl
local barrierEvent = game.ReplicatedStorage:WaitForChild("Barrier")

wait(1)
character.Archivable = true

local clone = character:Clone()
clone.Parent = game.Workspace

local cloneHumanoid = clone:WaitForChild("Humanoid")
local animate = cloneHumanoid:LoadAnimation(animation)

hitbox1.Touched:Connect(function(hit)
	if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
		if not debounce2 then
			debounce2 = true
			hitbox2.CanTouch = true
		end
	end
end)

hitbox2.Touched:Connect(function(hit)
	if hit.Parent and hit and hit.Parent:FindFirstChild("Humanoid") then
		if not debounce then
			debounce = true
			print("ok read it")
			clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(Vector3.new(14.154, 5.324, -101.504)) * CFrame.Angles(0,math.rad(-90),0)
			workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
			camerathing.CFrame = CFrame.new(Vector3.new(9.814, 10.154, -89.946)) * CFrame.Angles(math.rad(-21.2),math.rad(-36.18), 0)
			workspace.CurrentCamera.CFrame = camerathing.CFrame
			animate.Looped = false
			animate:Play()
			print("ok should be reading it now")


			wait(2.725)

			clone:MoveTo(Vector3.new(0,0,0))
			workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
			local character = hit.Parent
			print("Now Teleporting!")
			character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(Vector3.new(27.73, 5.174, -24.853)) * CFrame.Angles(0,math.rad(-90),0)
			barrierEvent:FireServer()
			debounce = false
		end
	end
end)



local camera = workspace.Camera
wait(1)
local newCamera = game.Workspace.CameraThing
local Camera2 = game.Workspace.CameraThing2
local tweenService = game:GetService("TweenService")

local bool = script.Bool

local barrierEvent = game.ReplicatedStorage:WaitForChild("Barrier")

local hitbox2 = game.Workspace.hitbox2
hitbox2.CanTouch = false

local crawlAnimation = script.Crawl
local animation = script.Animation
local humanoid = game.Workspace.Dummy:WaitForChild("Humanoid")
local animate = humanoid:LoadAnimation(animation)
local dummy = game.Workspace.Dummy
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local clickdetector = game.Workspace.testclick.ClickDetector

wait(1)

local event = game.ReplicatedStorage:WaitForChild("BrokenGlass")


local hitbox = game.Workspace.Hitbox
local debounce = false

local pos = Camera2.Position
local orientation = Camera2.Orientation



local info = TweenInfo.new(
	2.1,
	Enum.EasingStyle.Exponential,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local goal = {
	Position = pos;
	Orientation = orientation
}



local tween = tweenService:Create(newCamera, info, goal)


hitbox.Touched:Connect(function(hit)
	if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
		if not debounce then
			local character = hit.Parent
			local player = game.Players:GetPlayerFromCharacter(character)
			debounce = true
			dummy:MoveTo(Vector3.new(31.743, 4.001, -25.783))
			character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-1.791, 7.767, -26.509))
			camera.CameraType = Enum.CameraType.Scriptable
			camera.CFrame = newCamera.CFrame
			camera.CFrame = CFrame.new(Vector3.new(23.958, 8.424, -25.985)) * CFrame.Angles(0,math.rad(-90),0)
			wait(2)

			animate:Play()
			wait(3)
			tween:Play()
			local count = 0
			count = 0
			
			repeat 
				wait(0.00001)
				camera.CFrame = newCamera.CFrame
				count = count + 1
				print(count)
			until count >= 56
			event:FireServer()
			dummy:MoveTo(Vector3.new(52.854, 8.362, -24.021))
			camera.CameraType = Enum.CameraType.Custom
			Camera2:Destroy()
			wait(1)
		end
		
	end
end)
local IsTouched = false

bool.Value = true

wait(10)


Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Just do a check inside the .touched event’s function - if game.Players:GetPlayerFromCharacter(hit.Parent) == game.Players.LocalPlayer

1 Like

Thank you! I have been stuck on this for a couple of hours now. Sorry for the late response, I went to sleep an hour after this was posted.

1 Like