#trying to get a camera to work for my main menu
1 messages · Page 1 of 1 (latest)
my code
--//Services
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
--//Objects
local CameraPart = workspace:WaitForChild("CameraPart")
local CureentCamera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
--//Gui
local GUI = script.Parent
local PlayButton = GUI.PlayButton
--//Constants
local MOVE_SPEED =150
--//Functions
local function UpdateCamera()
local Center = CameraPart.CFrame
local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0)
CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0)
end
--//Events
local Connection = RunService.RenderStepped:Connect(UpdateCamera)
PlayButton.Activated:Connect(function()
Connection:Disconnect()
GUI:Destroy()
end)
it just spawns me in like this
** You are now Level 2! **
oh thank you
its my first time learning