Sprites still overlap after being destroyed

Hi, I’ve started making a game where you can interact with other sprites by pressing the A key. I noticed that when I changed the scene and destroyed a sprite that was no longer needed, I was still able to interact with the destroyed sprite in the new scene. You can see what I have so far here: https://makecode.com/_EpeKoViHwRUL

In the code you’ll see I have “on A button pressed” with a set of conditions. The first condition is for when you’re overlapping with mySprite2 (to talk to the NPC in the first scene). The second condition is for when you’re overlapping the brown door tile, and the first block in that condition destroys mySprite2. In the second scene though, if you move to the location of where the NPC used to be (just a bit below and to the right of the centre) and press A, the first condition is somehow still able to be true.

I don’t see any other blocks that would remove sprites and the help info for the destroy block even says “The sprite is removed from the game and will no longer overlap or collide with any other sprites.”

Is it a bug with the destroy block or is there something else in my code causing the issue?

Ah, looks like that one is currently just checking for if a sprite is a ghost and not if it is destroyed. If you set ‘ghost through sprites’ when destroying it for now it will work, I’ll fix it for the next release though. (Using the on overlap event will work as well~)

fix here: https://github.com/microsoft/pxt-common-packages/pull/1251/files

That’s great, thanks for the quick fix! We’re starting a course with a group of 9-12 year olds soon to build their own games, so I’ll make sure we don’t teach them about overlap until that release comes out :wink:

Fix is released in v1.4.41 as of a few minutes ago :slight_smile: