I've been scouring Google for almost 7 hours now to find a solution to this. I know how to get player XY coords and I can nab the mouse cursor XY on click through the touch input stuff but I can't seem to get it right. Any help would be greatly appreciated.
I'm aiming for having the character always facing wherever the mouse cursor is, almost like a top down shooter. However, simply turning to face the cursor direction on mouse click is just as well.
Please note, I don't want the mouse to move me, I just want it to turn which way I face.
How to face mouse cursor?
● ARCHIVED · READ-ONLY
-
-
The player XY coordinates would be based on the map, but the cursor XY coordinates are based on the screen/window. You need to convert the mouse position to map coordinates.
If you're familiar enough to scout around, the Game_Temp class in rpg_objects.js has a function called SetDestination which makes the player move to the spot clicked by the mouse. I suspect whatever calls it is what grabs the mouse screen coordinates and converts it to map coordinates, so if you find the calling function, you'll be able to check the logic.
Actually, the other thread you posted in had a solution. Did you try it?