#trying to get a camera to work for my main menu

1 messages · Page 1 of 1 (latest)

fossil hinge
#

for some reason it spawns me in with the gui on my screen but doesnt use the camera

#

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

hazy schoonerBOT
#

studio** You are now Level 2! **studio

fossil hinge
#

this is my camera part

fiery sparrow
#

It's underlined in red too...

fossil hinge
#

its my first time learning