Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Have the camera rotate when the mouse moves, but the MouseBehavior is set to LockCenter?

Starting at line 18, I need the camera to rotate around the player as it usually does, but instead of right clicking, the mouse is locked, and when the mouse is moved, the camera rotates.

wait(1)
local plr = game.Players:GetPlayerFromCharacter(script.Parent)
local chr = plr.Character
local play = plr.PlayerGui.Customize.Frame.Play
local mouse = plr:GetMouse()
local cam = game.Workspace.CurrentCamera
local rs = game:GetService("RunService")
local uis = game:GetService("UserInputService")
local editing = chr.Editing
local frame = plr.PlayerGui.Customize.Frame

local play = plr.PlayerGui.Customize.Frame.Play



rs.RenderStepped:connect(function()
	if editing.Value == false then
		
		
	end
end)

1 answer

No need for RenderStepped.

local player = game:GetService("Players").LocalPlayer
local editing = game.Workspace:WaitForChild(plr.Name):WaitForChild"Editing"
local mouse = player:GetMouse()

mouse.Move:Connect(function() -- It's Connect not connect. Coding is case sensitive
    if editing.Value == false then
    -- Do code
    end
end)

1 comment

0

Okay, but how do I know the direction (the way the mouse is moved)?

This discussion is preserved as it was. New answers, comments, and votes are closed.