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

How would I go about suppressing the mouse movement?

Asked by 4 years ago

I'm trying to replicate: http://gyazo.com/25dc73d14747ae63e81bf9443da8138e

and what I have so far is:

local Player = game:GetService("Players").LocalPlayer
local Cursor = Player:GetMouse()
local Camera = workspace.CurrentCamera
local part = workspace:WaitForChild("cam")
local yOffset = Camera.CFrame.Y

repeat wait() until Player.Character.Parent == workspace

Camera.CameraSubject = Cursor
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = part.CFrame

Cursor.Move:Connect(function()
    local cameraDirection = part.CFrame:toObjectSpace(Camera.CFrame).lookVector
    Camera.CameraSubject = Cursor
    Camera.CameraType = Enum.CameraType.Scriptable
    Camera.CFrame = part.CFrame
    Camera.CFrame = CFrame.new(part.Position, Cursor.Hit.p)
end)

The only problem seems to be that there's too much space I can look around, and it doesn't move smoothly.

0
try changing the mousemode NSMascot 113 — 4y

Answer this question