I'm trying to make a top down action view game and I need to have a camera where you can't rotate it(not in normal ROBLOX gameplay) I tried to do it with a click detector, it worked but when I deleted the click detector and the event it didn't work
So here is the hierarchy for the local script
Part -> game.Workspace.CameraPart LocalScript -> game.StarterPlayer.LocalScript
Here is also the hierarchy for the global script
Part -> game.Workspace.CameraPart GlobalScript-> game.Workspace.CameraPart.Script
Here is also the lines of code for both of the scripts
local camera = workspace.CurrentCamera game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function() camera.CameraType = Enum.CameraType.Scriptable camera.HeadLocked = false camera.CFrame = CFrame.new(script.Parent.Position) end) end)
Whoever can answer this question, please immediatley type it down if you can From : saSlol2436
So basically what you're going to want to do is make the CameraType Scriptable, as well as using camera.CoordinateFrame.
local camera = workspace.CurrentCamera game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function() camera.CameraType = "Scriptable" camera.CameraSubject = script.Parent camera.HeadLocked = false camera.CoordinateFrame = script.Parent.CFrame end) end)