# Way to check if a variable or sprite has updated/changed

**URL:** <https://forum.makecode.com/t/way-to-check-if-a-variable-or-sprite-has-updated-changed/45424>\
**Category:** Help\
**Created:** [August 16, 2026, 11:49pm UTC](https://forum.makecode.com/t/way-to-check-if-a-variable-or-sprite-has-updated-changed/45424 "2026-08-16T23:49:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sword\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sword_studios/32/35216_2.png) [@Sword\_Studios](https://forum.makecode.com/u/Sword_Studios)\
**Post date:** [August 16, 2026, 11:49pm UTC](https://forum.makecode.com/t/way-to-check-if-a-variable-or-sprite-has-updated-changed/45424/1 "2026-08-16T23:49:17Z")

</div>

Is there a way to do this? I am trying to make a teleport animation for a character in my game and to do this it needs to check if updated

---

<div class="post-metadata">

**Author:** ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)\
**Post date:** [August 17, 2026, 3:13am UTC](https://forum.makecode.com/t/way-to-check-if-a-variable-or-sprite-has-updated-changed/45424/2 "2026-08-17T03:13:35Z")

</div>

What do you mean updated/changed? Like the player’s state or something?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [August 17, 2026, 3:14am UTC](https://forum.makecode.com/t/way-to-check-if-a-variable-or-sprite-has-updated-changed/45424/3 "2026-08-17T03:14:06Z")

</div>

You can store an extra version of the variable you want to track and then constantly check if it’s still equal to the one that’s changing. If it’s ever not equal, you know the tracked variable has changed, so you run the code you want to run and then make sure to set the tracker variable to the tracked variable at the end.

---

<div class="post-metadata">

**Author:** ![Sword\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sword_studios/32/35216_2.png) [@Sword\_Studios](https://forum.makecode.com/u/Sword_Studios)\
**Post date:** [August 18, 2026, 2:25am UTC](https://forum.makecode.com/t/way-to-check-if-a-variable-or-sprite-has-updated-changed/45424/4 "2026-08-18T02:25:37Z")

</div>

Licke a block/function that checks if a variable updates like

on variable updated
