local Triangle = workspace.Triangle
local Length = math.sqrt(Triangle.Size.Y * Triangle.Size.Y + Triangle.Size.Z * Triangle.Size.Z)
local Angle = math.deg(math.acos(Triangle.Size.Z / Length))
I am using a wedge part as my triangle I just want to know if there is a more simple way of doing it and if my way can be used when I rotate the triangle and change its position and orientation
local opposite = Triangle.Size.Z
local adjacent = Triangle.Size.X
local angleInRadians = math.atan2(opposite, adjacent)
local angleInDegrees = math.deg(angle)
local RunService = game:GetService("RunService")
local Control = workspace.Control
local Pointer = workspace.Pointer
RunService.Heartbeat:Connect(function()
local Difference = Pointer.Position - Control.Position
local Angle = math.deg(math.atan2(Difference.X, Difference.Y)) - 180
print(math.abs(Angle))
end)