# Enemies Sprites Freezing

**URL:** <https://forum.makecode.com/t/enemies-sprites-freezing/29717>\
**Category:** Help\
**Created:** [July 16, 2024, 6:32pm UTC](https://forum.makecode.com/t/enemies-sprites-freezing/29717 "2024-07-16T18:32:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skels](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@skels](https://forum.makecode.com/u/skels)\
**Post date:** [July 16, 2024, 6:32pm UTC](https://forum.makecode.com/t/enemies-sprites-freezing/29717/1 "2024-07-16T18:32:50Z")

</div>

Hello! I’ve been having this issue where whenever my character gets out of their “iframe state” all the current enemies freeze. I’ve tried to fix it with making a new function that makes it so the enemies follow the player, but it doesn’t work. Please Help!

The Game: [https://arcade.makecode.com/S98675-78942-37659-68199](https://arcade.makecode.com/S98675-78942-37659-68199)

---

<div class="post-metadata">

**Author:** ![NeoStreak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neostreak/32/27498_2.png) [@NeoStreak](https://forum.makecode.com/u/NeoStreak)\
**Post date:** [July 16, 2024, 8:43pm UTC](https://forum.makecode.com/t/enemies-sprites-freezing/29717/2 "2024-07-16T20:43:53Z")

</div>

When taking damage make the damage taken pause so that the health reduction is paused but not the enemies.

---

<div class="post-metadata">

**Author:** ![anon30657772](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@anon30657772](https://forum.makecode.com/u/anon30657772)\
**Post date:** [July 18, 2024, 5:48am UTC](https://forum.makecode.com/t/enemies-sprites-freezing/29717/3 "2024-07-18T05:48:17Z")

</div>

The reason why the enemies stop moving all of a sudden after you get hit is because of the way you implemented the “iframes”. Since you destroy the original sprite that the enemies were following (by giving it a lifespan), they do not have anything else to follow so they stop.

As @NeoStreak said, you can simply just use a pause block in the overlap without using the “iframes” system.

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [July 18, 2024, 4:57pm UTC](https://forum.makecode.com/t/enemies-sprites-freezing/29717/4 "2024-07-18T16:57:36Z")

</div>

For iframes I always use the once every xms block in the timer extension and just adjust that for how long I want the iframe to be
