I have the following code:
Dummy = CreateDummySprite()
SetSpriteCategoryBits(Dummy,Block)
AddSpriteShapeBox(Dummy,x1,y1,x2,y2,0)
for i = 0 to MapSize
if mapTable[i].terrain = Trees
. . .
AddSpriteShapeBox(Dummy,x1,y1,x2,y2,0)
endif
next i
if PhysicsRayCastCategory( Block,x1,y1,x2,y2 )
. . .
If the code finds trees tiles on a map, then it adds a sprite shape box to a dummy sprite equal in dimension to that tile. The shape box is assigned to a "Block" category. Then the code casts a physics ray through the map and is supposed to detect any "Block" category sprites (the trees), but never detects any. What am I doing wrong? I've also tried the same code using groups rather than categories and SpriteRayCastCategory/Group rather than PhysicsRayCastCategory/Group with the same results.