# Overlap not working

**URL:** <https://forum.makecode.com/t/overlap-not-working/34695>\
**Category:** Help\
**Created:** [March 18, 2025, 4:54pm UTC](https://forum.makecode.com/t/overlap-not-working/34695 "2025-03-18T16:54:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sampler2000](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sampler2000](https://forum.makecode.com/u/Sampler2000)\
**Post date:** [March 18, 2025, 4:54pm UTC](https://forum.makecode.com/t/overlap-not-working/34695/1 "2025-03-18T16:54:47Z")

</div>

Hey, i’m making a sad Mario but the overlap won’t work. Please check my code and tell me how to fix it. [https://arcade.makecode.com/S31550-31826-29123-82936](https://arcade.makecode.com/S31550-31826-29123-82936)

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [March 19, 2025, 5:30pm UTC](https://forum.makecode.com/t/overlap-not-working/34695/2 "2025-03-19T17:30:03Z")

</div>

Overlap code seems to be inside the “If mysprite x \> 140 and teleport = true”, wich means it only happens if those conditions are met, wich is impossible since you set teleport to false after switching to the tilemap with the actual sprites you would collide with.

 ![1000050014](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/3/e33ba2c9d7b9ac9d59ab6ce42ecb83396374cb18.jpeg)

Maybe try having the overlap code run on a separate “forever, if teleport = false” block?

---

<div class="post-metadata">

**Author:** ![Sampler2000](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sampler2000](https://forum.makecode.com/u/Sampler2000)\
**Post date:** [March 20, 2025, 12:29pm UTC](https://forum.makecode.com/t/overlap-not-working/34695/3 "2025-03-20T12:29:25Z")

</div>

ok I’ll try it! thanks for the recommendation!

---

<div class="post-metadata">

**Author:** ![Sampler2000](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sampler2000](https://forum.makecode.com/u/Sampler2000)\
**Post date:** [March 20, 2025, 12:39pm UTC](https://forum.makecode.com/t/overlap-not-working/34695/5 "2025-03-20T12:39:19Z")

</div>

Also, the overlap seems to be glitching. Im a couple inches above the sprite and it kills me!

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [March 20, 2025, 8:55pm UTC](https://forum.makecode.com/t/overlap-not-working/34695/6 "2025-03-20T20:55:44Z")

</div>

Can you share an updated link? im not sure what would cause them to do so.

---

<div class="post-metadata">

**Author:** ![Sampler2000](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sampler2000](https://forum.makecode.com/u/Sampler2000)\
**Post date:** [March 21, 2025, 10:40pm UTC](https://forum.makecode.com/t/overlap-not-working/34695/7 "2025-03-21T22:40:30Z")

</div>

Hey sorry invalid link! [https://arcade.makecode.com/S31550-31826-29123-82936](https://arcade.makecode.com/S31550-31826-29123-82936)
