Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make the camera to be fixed in one direction?

Asked by
boyoss 2
3 years ago

I'm trying to make a menu that has a background and I made it so one part is the camera and the player view has to be the part camera

This is the script I've done but isn't working

the script is called CameraScript

the part is called MenuCamera and there is a text button called Play also, the frame is an actual frame item and the ScreenGui is called MenuGui

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Mouse = player:GetMouse()
local Camera = workspace.CurrentCamera

local Play = script.Parent.Frame.Play

repeat wait()
    Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = workspace.MenuCamera.CFrame

Play.MouseButton1Click:Connect(function()
    Camera.CameraType = Enum.CameraType.Custom
    script.Parent.Frame:Destroy()


end)

Answer this question