# removeSprite - sometimes

**URL:** <https://forums.solar2d.com/t/removesprite-sometimes/325062>\
**Category:** Million Tile Engine\
**Created:** [April 29, 2014, 9:07pm UTC](https://forums.solar2d.com/t/removesprite-sometimes/325062 "2014-04-29T21:07:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg\_brady](https://forums.solar2d.com/user_avatar/forums.solar2d.com/greg_brady/32/430_2.png) [@greg\_brady](https://forums.solar2d.com/u/greg_brady)\
**Post date:** [April 29, 2014, 9:07pm UTC](https://forums.solar2d.com/t/removesprite-sometimes/325062/1 "2014-04-29T21:07:14Z")

</div>

\*\* I found a duplicate call to removeSprite with (,false) set so it wasn’t removing the sprite, It seems to be working better, hopefully that was the problem.

Hi dyson,

I’m having a problem with removeSprite… most of the time the sprite gets removed, about 5% of the time the sprite will remain after running:

t=event.target

if enemy[t.index] ~= nil then

&nbsp;&nbsp; mte.removeSprite(enemy[t.index], true)

end

I know the code is executing, just a strange problem that I haven’t tracked down yet. When I shoot the enemy a second time, the sprite gets removed…

I’ve checked t.index, and it is the same from the first call to the second.

Thanks, Greg
