Need help with the overlap block

Not sure if this is a bug, but with the “on [sprite] overlaps [sprite] of kind [category]” block, I can’t change the variable from “othersprite” to my own variable. Any help is appreciated!

‘otherSprite’ in this case means the specific ‘Object’ sprite that is overlapping with a ‘Player’ when this code runs; you’re able to have a lot of both of those at once. If you only have one Object that is stored in the ‘cursor’ variable, then both will mean the same thing at this time / it’s intentional you can’t drag one into that spot. (If you have multiple Objects and want to narrow it down, you would either change the kind of the sprite to something else, like Cursor (probably best), or put an if (otherSprite == cursor) around the rest of the code you want to put in this block (a little harder to understand in general but would do the job))

1 Like

The “othersprite” isn’t a sprite you replace, it’s a parameter for you to drag out to reference the exact sprite that was overlapped. For example, if you have a sprite with the kind “player” overlapping with a sprite with the kind “object”, you can use otherSprite to get the exact sprite that was overlapped by the “player” sprite.

Welcome to Makecode @critter! I hope you have a good time here!

1 Like

are you able to right click it? (I don’t have access to a computer right now)