I have a 2d camera setup made for my upcoming platformer (you cant move the camera and it follows you) I want to unlock it, and make it turn into normal camera when I touch a brick. For example, at the end of a level when I touch a brick to teleport to the lobby, I want the camera to unlock.
-- 2d camera script in ServerScriptService function setchar(p) p.CameraMinZoomDistance = 5 --instead of 0.5 where they can "zoom in"/"angle" their character local c = p.Character while not p.Character or not p.Character.Parent do wait(.1) c = p.Character end c:WaitForChild'HumanoidRootPart' script.bpos:Clone().Parent = c.HumanoidRootPart end for _,p in next, game.Players:GetPlayers() do if p.Character and p.Character.Parent then setchar(p) end p.CharacterAdded:connect(function() setchar(p) end) end game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function() setchar(p) end) end)
--2d script in starter gui p = game.Players.LocalPlayer rs = game:GetService('RunService') cam = workspace.CurrentCamera cam.CameraType = 'Scriptable' rs.RenderStepped:connect(function() if p.Character and p.Character:FindFirstChild('HumanoidRootPart') then cam.CoordinateFrame = CFrame.new(Vector3.new( 30, p.Character.HumanoidRootPart.Position.y+1.5, p.Character.HumanoidRootPart.Position.Z ), p.Character.HumanoidRootPart.Position) end end)
--2d script in ReplicatedFirst wait(5) cam = game.Workspace.CurrentCamera cam.CameraSubject = game.Workspace.Players cam.CameraType = "Attach"
This is a script I made to try and fix the issue I am getting, but it doesn't work at all
script.Parent.Touched:connect(function() game.ServerScriptService.SideCamServer.Disabled = true game.StarterGui.SideCamClient.Disabled = true game.ReplicatedFirst.CameraScript.Disabled = true end)
I hope someone replies soon as I cannot continue my development with this issue