Sprite delete, empty are dealing the console error

Hi! I’ve looked through the documentation and found no solution yet.
I’m trying to create a sprite when some action happens, and when the action ends, I want sprite to disappear. The thing is, when I’m using delete_sprite or empty_sprites that’s what I get after loading or Continue game:

I found a trick, to hide the sprites with moving these .x to -1000 or somewhere further, but seems there should be a proper solution as I still have to consider set_screen animations on which the sprite is “loaded” again with such a flow?

:chrome: :windows:

:gear:

This probably happens if a variable still exists which has a reference to the sprite after you’ve deleted it. So when reloading the game it finds a variable that’s a sprite, but the matching sprite doesn’t exist hence the warning

Best practice here is to make sure that variables you have for that sprite get set to some other value if you delete it

(the sprite system is a bit clunky for that reason)