# We can't get a sprite to disappear!

**URL:** <https://forum.code.org/t/we-cant-get-a-sprite-to-disappear/31955>\
**Category:** Coding and Debugging Help\
**Created:** [December 18, 2019, 12:55pm UTC](https://forum.code.org/t/we-cant-get-a-sprite-to-disappear/31955 "2019-12-18T12:55:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eauger](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@eauger](https://forum.code.org/u/eauger)\
**Post date:** [December 18, 2019, 12:55pm UTC](https://forum.code.org/t/we-cant-get-a-sprite-to-disappear/31955/1 "2019-12-18T12:55:18Z")

</div>

Hi!  
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!

[https://studio.code.org/projects/gamelab/\_dERAK-THek40QmTM4eT\_dlntsQPhJle8UNKU20Ss2c](https://studio.code.org/projects/gamelab/_dERAK-THek40QmTM4eT_dlntsQPhJle8UNKU20Ss2c)

---

<div class="post-metadata">

**Author:** ![mwood](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/mwood/32/4941_2.png) [@mwood](https://forum.code.org/u/mwood)\
**Post date:** [December 18, 2019, 3:16pm UTC](https://forum.code.org/t/we-cant-get-a-sprite-to-disappear/31955/2 "2019-12-18T15:16:56Z")

</div>

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.

Mike

---

<div class="post-metadata">

**Author:** ![eauger](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@eauger](https://forum.code.org/u/eauger)\
**Post date:** [December 18, 2019, 7:12pm UTC](https://forum.code.org/t/we-cant-get-a-sprite-to-disappear/31955/3 "2019-12-18T19:12:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eauger](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@eauger](https://forum.code.org/u/eauger)\
**Post date:** [December 18, 2019, 7:18pm UTC](https://forum.code.org/t/we-cant-get-a-sprite-to-disappear/31955/4 "2019-12-18T19:18:31Z")

</div>

Thank you that worked!
