# Place (Sprite) on top of random (Tile) not working

**URL:** <https://forum.makecode.com/t/place-sprite-on-top-of-random-tile-not-working/17577>\
**Category:** Help\
**Created:** [January 24, 2023, 9:04pm UTC](https://forum.makecode.com/t/place-sprite-on-top-of-random-tile-not-working/17577 "2023-01-24T21:04:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JorginLegal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jorginlegal/32/7262_2.png) [@JorginLegal](https://forum.makecode.com/u/JorginLegal)\
**Post date:** [January 24, 2023, 9:04pm UTC](https://forum.makecode.com/t/place-sprite-on-top-of-random-tile-not-working/17577/1 "2023-01-24T21:04:56Z")

</div>

I’ve been developing a game in makecode arcade for quite some time now, and recently hit a major roadblock for the game because of a single bug ruining the level design’s functionality: The “Place (Sprite) on top of random (Tile)” block is not working.

In my game, i use the block to teleport the player character to it’s spawn point at the beginning of a section(tilemap), but ever since i overhauled the level loading function, it stopped working entirely.

I would share a link to the original project, however i don’t wanna spoil my game in a help thread so i painted over the actual art to share it: [https://makecode.com/\_i4dMfcJMoLk7](https://makecode.com/_i4dMfcJMoLk7)

To notice the bug, You need to take the following routes:

1. Works as intended;
2. Works as intended, though i think that’s just because 1’s exit coincides with 2’s entrance;
3. If the last object you went to was the right one you appear at the wall;
4. If the last object you went to was the right one you appear at the right part with the coin and can’t move on due to the camera;
5. Depending where you went last you either appear on top of the clouds or by the bottom wall, neither intended behaviors (You’re supposed to show up at the T level entrance)

As for if it’s an extension that’s causing this, the game uses so many it could be any of them so i’ll just list all of them:  
Timers;  
Color Fading;  
pxt-button-combos;  
arcade-tile-util;  
arcade-text;  
character-animations;  
arcade-premium-life;  
ColorBlock;  
pxt-sound-effects;  
arcade-mini-menu.  
Also for some reason i have both a “Tile Util” and “Tilemaps” Tab, so i probably missed one.

Does anyone have an idea what could be causing this?

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [January 25, 2023, 12:43am UTC](https://forum.makecode.com/t/place-sprite-on-top-of-random-tile-not-working/17577/2 "2023-01-25T00:43:30Z")

</div>

I’m a bit confused by the directions / don’t really know the intended behavior here, but open this link in a private browsing window (right click → open in incognito / private browsing / etc, whatever your browser of choice calls it): [https://arcade.makecode.com/beta#pub:\_i4dMfcJMoLk7](https://arcade.makecode.com/beta#pub:_i4dMfcJMoLk7) and let me know if it repros thre

Two possible solutions to this bug:

- remove `stay in screen` from the sprite you are `camera follow`ing  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/04731541f5f1287b28ebc907b6caca4539d4f146.png)

- Wait a few weeks

reason being, this sounds like you’re hitting this bug: [https://github.com/microsoft/pxt-arcade/issues/5452](https://github.com/microsoft/pxt-arcade/issues/5452), which I fixed here: [https://github.com/microsoft/pxt-common-packages/pull/1386](https://github.com/microsoft/pxt-common-packages/pull/1386)

---

<div class="post-metadata">

**Author:** ![JorginLegal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jorginlegal/32/7262_2.png) [@JorginLegal](https://forum.makecode.com/u/JorginLegal)\
**Post date:** [January 25, 2023, 3:35am UTC](https://forum.makecode.com/t/place-sprite-on-top-of-random-tile-not-working/17577/3 "2023-01-25T03:35:46Z")

</div>

I can’t express how good it feels to have that bug fixed, thanks a lot!!!

As for why the block was there in the first place, it was meant to be a preventative measure so that the character would always stay in screen even if you went so fast the camera couldn’t keep up, although now i think i might be better without it since it would’ve been somewhat jarring to suddenly stop if you went too fast.
