How to get XY coordinate with distance and angle.

2
  • 15 favourites

Stats

5,706 visits, 8,986 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

If you have used GameMaker, you might know this as lengthdir_x,y. This isn't available in Construct, but really its just a simple formula. For that reason, this tutorial will contend with being one of the shortest out there.

I recommend making a function with the following ACE:

What this calculates is the relative X or Y coordinates based on only the knowledge of how far and at what angle the point is. Add the returning number to your objects X or Y value to get the proper coordinates of your target.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!