im trying to get this brick to rotate when i move my mouse down but it will go insanely fast if i move it even slightly, and when it slows down it will suddenly go fast again even if im not using my mouse.
link to a video of the problem https://gofile.io/?c=uSpnf1
my code
local players = game:GetService("Players")
local player = players.LocalPlayer
local Uis = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local part = workspace.Part
local bg = Instance.new("BodyGyro")
local function move(mdy)
bg.CFrame = bg.CFrame * CFrame.new(0,0,0) * CFrame.Angles(math.rad(mdy),0,0)
print(mdy)
end
runService.RenderStepped:Connect(function()
local mouseDelta = Uis:GetMouseDelta()
bg.Parent = part
part.Position = Vector3.new(0,5,0)
bg.MaxTorque = Vector3.new(1,1,1)
bg.P = 10
if mouseDelta.Y > 0 then
move(mouseDelta.Y)
end
end)
