#Main Menu Camera Lock
1 messages · Page 1 of 1 (latest)
Send the script
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local camera = Workspace.CurrentCamera
-- Set the camera to Scriptable and lock its position and orientation
camera.CameraType = Enum.CameraType.Scriptable
-- Set the camera position above the Baseplate (or at a fixed location)
local baseplate = Workspace:FindFirstChild("Baseplate")
local fixedPosition = Vector3.new(10, 13)
if baseplate then
fixedPosition = baseplate.Position + Vector3.new(0, 20, 0)
end
local fixedLookAt = fixedPosition + Vector3.new(0, -1, 0)
camera.CFrame = CFrame.new(fixedPosition, fixedLookAt)
-- Make sure mouse can move freely
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
-- Keep camera locked every frame (in case something tries to move it)
RunService.RenderStepped:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CFrame.new(fixedPosition, fixedLookAt)
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end)
I'll try to fix it when I get back
it works fine for me, did you add something else? Like a new feature and then the camera broke?
I dont think so, i saved The game and after that it was just not working
Oh