I’m using rayCast() to check if different points are occupied. the reason I’m using rayCast() is because it doesn’t require extra objects(empties usually) to test the existence of objects with the near/collision sensor. I’m using a modified flood-fill algorithm to fill an area with squares, each of which needs to check up, down, left, and right to see if there is anything there. I need to do this test for every square. That means anywhere from 4 to 4000 rayCast’s need to take place. This takes too much time. I don’t want the player waiting 1-10 seconds every time this event occurs, which is often.
should I use empties and near sensors? something else?
[SOLVED]
instead of using raycast, I should use a matrix(list) to keep track of what areas on my grid are occupied.