Im putting my recently learned knowledge of Trigonometry to the test, What did I did do wrong in this script?
I took both X and Y distances, and used atan (Opposite/Adjavent) to try and find the angle, Whats wrong here?
local t1 = game.Workspace.t1
local t2 = game.Workspace.t2
local run = game:GetService("RunService")
run.RenderStepped:Connect(function()
local directionY = (t2.Position.Y - t1.Position.Y) -- Distance Y
local directionX = (t2.Position.X - t2.Position.X) -- Distance X
wait(.5) --Opposite-- --Adjacent--
local angle = math.atan(math.rad(directionY/directionX))
print(angle)
end)