Corners for my auto tiling bundle

i have this sprite right here

which is the bottom left corner sprite of my tileset. but when using a raycast to detect if it should play tht animation or not, it seems like the raycast is picking up the blocks on the sides

image

can anyone think of a better way to do this?

I think you should separate your blocks into ground and no collision.
Turning off collision to blocks you never touch would help with lag later on.
And for these corner block could see if its in a corner between 2 ground objects.

sorry, I’m not sure i understand what you mean

Basically try using 2 ground blocks
One with collision, and another for no collision.

The no collision blocks will be anywhere the player can’t touch, including corners.
Having no collision in these spaces also helps with lag in the long run.