Aye, yo. I’m tryna get the angle (θ) (θ - greek small letter theta (u+03B8) copy and paste - Unicode® symbol)) from the direction of where the mouse has moved. I was thinking I have to use some sort of trigonometry. Thing is, I don’t know trigonometry. ;-; But here’s my initial thought;
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local center = Vector2.new(500,500)
local origPos
local endPos
mouse.Button1Down:Connect(function()
origPos = Vector2.new(mouse.X, mouse.Y)
end)
mouse.Button1Up:Connect(function()
endPos = Vector2.new(mouse.X, mouse.Y)
local length = (endPos - origPos).Magnitude
end)
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local origin
local endPos
mouse.Button1Down:Connect(function()
origin = Vector2.new(mouse.X, mouse.Y)
end)
mouse.Button1Up:Connect(function()
endPos = Vector2.new(mouse.X, mouse.Y)
local length = (origin - endPos).Unit --idrk, i just called it length
local angle = math.deg(math.atan2(length.Y, length.X))
end)