So let’s say you’re actually 3 meters up, but 4 meters to the left/right of the waypoint. (I used 3 and 4 for easy calculation)
Using Pythagoream’s Thereom (which states for a right triangle with leg lengths a and b and hypotenuse length c, then a^2+b^2=c^2), we can figure out the hypotenuse.
a^2+b^2=c^2
3^2+4^2=c^2 Plug in values
9+16=c^2 Solve
25=c^2 Solve
sqrt(25)=c Take square root of both sides
c=5 Solve and flip sides
So, the waypoint displays 5 meters, not 3 meters (the correct one)
2nd Flaw
If you make a game like Dig It Up, where you can go below sea level, your waypoint will display a positive number if you go under it.
Alternatively, you could use a coordinate system for the platformer height, but filling up the whole map with zones on the x and y-axis is tedious and very, very memory-consuming. So, you could make multiple blocks as a meter and that’ll do.
YES!!
we need more guides like this. 27 votes on the poll with 3 likes? guides with math in them need more love. i guess people are scared of math, (oooh scary), even though we learn the pythagoreams thereom in 5th grade. (at least for me.)
jokes aside, you did a nice job on this, can’t wait for it to be finished!