You are not logged in.
Pages: 1
/*
** Usage:
** id = instance_nearest_maxdist(x,y,obj,maxdist);
**
** Arguments:
** x x coord
** y y coord
** obj object to find
** maxdist, the maximum distance acceptable
**
** Returns:
** id the id of the instance found or noone if none or self is found or if the distance to the instance found is too far
**
** Notes:
** like instance_nearest_notme adding distance as a factor
**
** GMLscripts.com
*/
var xx; xx = x;
x = -10000000
var ret; ret = noone;
with(instance_nearest(argument0,argument1,argument2))
{
if(id != other.id)
if(point_distance(x,y,argument0, argument1)<argument3)
ret = id;
}
x = xx
return ret;
Offline
Pages: 1