I need help , my sprite wont be destroyed on contact

so basically what I did what make it so that when my projectile makes contact with the player it gets destroyed but then I realised that It picks a random one to destroy instead of the one that touches the player, how to fix

1 Like

i don’t know, but hi, welcome to the community of makecode arcade.

If you use the
(on (sprite) of kind (player) touches (other sprite) kind (projectile)
Block, you should be able to drag (othersprite) red bubble to the destroy block.

First Welcome To the Makecode Comunity

Second Here is a small game with your problem fixed and here is how

I belive the problem is that when you destroyed the projectile you didn’t destroy the one on it used the newest version of that variable (The newest bullet) NOT the one overlapping with the Sprite

The Bottom one is the one you need

and the Top is the glitched one

its not a random one its the latest one
this is a common error when you start or never really use such blocks
what you did here was you used the sprite it self and not the one in the function

insted of using the sprit it self like this
image
use the variable in your function like so
image
when you create more then one sprite with the same variable when you try to make it do something it only applies to the last one you created