Spicy!
I'm Jonathan Islas
Also a 5th semester ISI student
Can find me in:
/JonyIsland
/jonywar
image_angle = point_direction(x, y, mouse_x, mouse_y);
GML:
Unity:
private Vector2 mousePos;
private Vector3 screenPos;
void Update () {
mousePos = Input.mousePosition;
screenPos = camera.main.ScreenToWorldPoint(Vector3(mousePos.x, mousePos.y, transform.position.z - camera.main.transform.position.z));
transform.rotation.eulerAngles.z = Mathf.Atan2((screenPos.y - transform.position.y), (screenPos.x - transform.position.x))*Mathf.Rad2Deg;
}