Answered
How to push an object on mouse over?
What is the best method for tracking the angle of the mouse as it moves over an object so I can push the object in the same direction the mouse is moving with a tween?
Thank you!
What is the best method for tracking the angle of the mouse as it moves over an object so I can push the object in the same direction the mouse is moving with a tween?
Thank you!
use Math.atan2():
var angle:Number=180*Math.atan2(mouseY-object.y,mouseX-object.x)/Math.PI;
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.