Compare if objects closest in x and y axis match object name

A template for a Candy Crush game was posted. I haven’t looked at it but some of the logic might be similar to what you need.