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

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

Asked by
Jo_Bot 67
6 years ago

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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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)
0
Okay, but how do I know the direction (the way the mouse is moved)? Jo_Bot 67 — 6y
Ad

Answer this question