Good for weapons that fire in the direction of the mouse
[Arrow] Graphic = @ Texture = arrow.png Pivot = center Position = (0, 0, 0)
orxVECTOR arrowPosition = orxVECTOR_0; orxObject_GetPosition(arrow, &arrowPosition); orxVECTOR mousePosition = orxVECTOR_0; orxMouse_GetPosition(&mousePosition); orxRender_GetWorldPosition(&mousePosition, orxNULL, &mousePosition); orxVECTOR direction = orxVECTOR_0; orxVector_Add(&direction, &arrowPosition, &mousePosition); orxFLOAT angle = orxMath_ATan(direction.fY, direction.fX); orxObject_SetRotation(arrow, angle);