Windows Collision mask not applied when calling Distance_to_point()

Club

Member
(First time posting. Correct me if i'm doing anything wrong)
The scenario is: I have a planet sprite and a player sprite. I want the planet sprite to turn green when the player sprite gets close.
Player obj is controlled by arrow keys and moves about the room. Both collision masks are set to precise by frame.

following code is in step event in planet object:

if ( distance_to_point ( obj_player.x, obj_player.y )<80){
image_blend=c_lime;
}


Player turns green when player enters a box around the planet. Almost as if the collision mask was set to rectangle and not the precise image of a round planet. wondering if this method isnt based on collision masks? The documentation makes me believe it should be. Any help or workarounds would be appreciated.
 
From the manual:
This function calculates the distance from the edge of the bounding box of the calling instance to the specified x/y position in the room.
The bounding box is not circular, it has 4 points: x1, y1, x2 and y2 which forms a square. You should use point_distance(x,y,obj_player.x,obj_player.y) instead, as this will be a circular check.
 
Top