function fxDTSBrick::calculateNeighbors(%this,%group)
{
%thisPos = %this.getPosition();
for(%i=0;%i<%group.getCount();%i++)
{
%brick = %group.getObject(%i);
%pos = %brick.getPosition();
%dist = vectorDist(%thisPos,%pos);
if(%dist <= $Paths::MaxDist && %brick !$= %this)
{
-snip-
%ray = containerRayCast(%thisPos,%pos,$TypeMasks::FxBrickAlwaysObjectType,%this);
-debug snip-
%obj = firstWord(%ray);
if(isObject(%obj) && %brick.getPosition() $= %obj.getPosition())
{
talk("ray works");
%this.neighbor[%this.neighbors++] = %brick;
}
}
-snip-
}
%this.neighbors = %this.neighbors++;
}
just focus on the part with the raycast.
it seems to never want to work.
The debugs always show it just returning 0 everytime.