No Revisions Have Been Made To This Page
Can you suggest an edit for this page? Click Here
GML Code Example
All instances in GameMaker: Studio have certain "built
in" properties that you can use and set to govern how they look and
behave. Direction is one of those properties and can be
used to set the direction of movement of the instance when the
instance has a speed other than
0. Note that directions in GameMaker: Studio are usually
calculated as 0° being right, 90° being up, 180° being left and
270° being down.
These examples are submitted by the community. Upvote the examples you think are most helpful.
direction towards mouse by /u/tmcicuurd12b42 on January 19, 2017
///create speed = 4; ///step direction = point_direction(x,y,mouse_x,mouse_y); ///draw draw_text(x,y,direction); /* See It In Action: https://yal.cc/r/gml/?mode=undefined&lzgml=MQEwpgZglgdmAEBbAhrAUAeiwYwE5mQBcw0BnABzDBHgF54AWAbjTVElgVOPMy27C8QUfNkJQA9jDrxyE2IQD6w0eKkAKAB4AaAJ7bEEgK6kwinYZNndAShZtw0OPBC5kAdz4ZXHtD-eKxJqEWnraKmBikjB2rEA */