V
volky
Guest
I am trying to get the distance between an object and the target. I had difficulties finding the issue and tried to do the same with a simple example:
However, the code above now gives:
Should not it give
instead?
I can do a workaround by using
GML:
with(obj_robotPlayer) {
show_debug_message("current locations x,y: " + string(x) + "," + string(y));
show_debug_message("distancey: " + string(distance_to_point(x, y + 100))); // diff -29
show_debug_message("distancex: " + string(distance_to_point(x + 100, y))); // diff -25
}
Code:
current locations x,y: 100,100
distancey: 71
distancex: 75
GML:
current locations x,y: 100,100
distancey: 100
distancex: 100
I can do a workaround by using
if(distance_to_point(toGoX + 25, toGoY + 29) < 10)
, but any idea why I have this issue?