Detect when sprites are next to each other, but not overlapping

Hi. There’s ways to detect if a sprite is next to a wall or a particular tile, but what about another sprite?

I tried:

  • Detecting if the image of the sprite is next to me
  • Detecting if the location next to me is the same location as the sprite’s current location

Ideally, I would like to detect if a sprite of a particular kind is next to me, but not overlapping.

1 Like

Maybe create a hitbox, if that is possible. (I have no idea how)

so if it’s a specific number of pixels away from a sprite?
image
sprite utils has blocks that might be helpful for that

You can put a sprite around the sprite

(using this method would require you to camouflage the box with the pixels behind it, I’d much recommend using sprite until instead)