We can't get a sprite to disappear!

one of my students can’t get a sprite to disappear using destroy or visible= false. She wants the mission sprite to disappear after the space bar is pressed. So far, using the .visible block it only disappears for less than a second and then reappears. Using the destroy block gives an error on line 37 (ERROR: Line: 37: TypeError: mission.destroy is not a function). I have few theories about what’s causing the issues, but I’m not sure how to fix them. Please help!


I think the issue here is that mission isn’t a sprite, but rather a variable with text inside.

Try getting rid of the mission.destroy line and replacing it with the following:
mission = "";

This will replace the startup text with nothing, so it will still display, but it will display nothing.

Let us know if this works or if you need it to do something else.


Thank you! I’ll try that. I feel a little silly that I forgot it wasn’t a sprite!

Thank you that worked!