If the size of the cell as defined in the World is larger than the size of the image for the Actor (for example if you want a small gap between cells) then getNeighbours() may not return a number that would be reasonably expected as provided by the documentation:
Return the neighbours to this object within a given distance. This method considers only logical location, ignoring extent of the image. Thus, it is most useful in scenarios where objects are contained in a single cell.
All cells that can be reached in the number of steps given in 'distance' from this object are considered. Steps may be only in the four main directions, or may include diagonal steps, depending on the 'diagonal' parameter. Thus, a distance/diagonal specification of (1,false) will inspect four cells, (1,true) will inspect eight cells.
For reference:
World Cell size / Image Size = Result
16 / 16 = true
17 / 16 = true
18 / 16 = true
19 / 16 = false
What is the logic behind identifying neighbours? If I write my own version using getObjectsAt it works fine...
Thanks in advance.
p.s. Many hours spent finding this one.