I need to retrieve the direction of my player

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I am making an overhead-view game with WASD movement controls and mouse aiming controls.
    I have made a player and a hitbox for the player, and whenever the hitbox isn't touching a wall the game is supposed to remember the player's x&y position along with the direction of the player so that when the hitbox overlaps a wall, the player moves back to the said saved x&y position and rotates back to the saved rotation. However, I see no option to retrieve the player's rotation, which causes problems because the hitbox changes depending on the direction of the player.

    So in short, how to I retrieve the direction of the player?

    Thanks.

  • You can use the expression Dir( "Active" ) , with Active as the name as the player. You can also get this by clicking on the player in the Expression Editor and going to Animation > Current direction value.

    Please login to see this link., Please login to see this link.
    Discord: Please login to see this link., Please login to see this link., Please login to see this link.

  • You can use the expression Dir( "Active" ) , with Active as the name as the player. You can also get this by clicking on the player in the Expression Editor and going to Animation > Current direction value.

    Thanks a lot! Never thought it'd be in the animations tab.

  • Careful, the Direction expression retrieves the direction used by mmf movements. It is not going to help if you need the animation direction ( the direction arrow you see in the animation image editor) or if you are rotating something and want the rotation value.

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!