Hello , i have this little script right here that tries to calculate the angle between a part and the mouse’s position :
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local mouse = player:GetMouse()
local arrow = game.Workspace.Arrow
local mouseDirection
mouse.Move:Connect(function()
mouseDirection = arrow.CFrame:ToObjectSpace(mouse.Hit).LookVector
print(-math.asin(mouseDirection.X))
arrow.CFrame = arrow.CFrame * CFrame.Angles(0,-math.atan(mouseDirection.X/mouseDirection.Y),0)
end)
Here’s the result :