# Can you put a background in front of raycasting?

**URL:** <https://forum.makecode.com/t/can-you-put-a-background-in-front-of-raycasting/29832>\
**Category:** Arcade\
**Tags:** game\
**Created:** [July 25, 2024, 11:43pm UTC](https://forum.makecode.com/t/can-you-put-a-background-in-front-of-raycasting/29832 "2024-07-25T23:43:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ollie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ollie/32/16530_2.png) [@ollie](https://forum.makecode.com/u/ollie)\
**Post date:** [July 25, 2024, 11:43pm UTC](https://forum.makecode.com/t/can-you-put-a-background-in-front-of-raycasting/29832/1 "2024-07-25T23:43:27Z")

</div>

> **[game](https://arcade.makecode.com/S95600-50008-71650-50989)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![neintoes](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neintoes/32/8315_2.png) [@neintoes](https://forum.makecode.com/u/neintoes)\
**Post date:** [July 26, 2024, 5:02pm UTC](https://forum.makecode.com/t/can-you-put-a-background-in-front-of-raycasting/29832/2 "2024-07-26T17:02:07Z")

</div>

Not that I’m aware of. You’d be better served creating your hand as a sprite and setting it’s ‘RELATIVE\_TO\_CAMERA’ SpriteFlag to true.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/7/3725865ef6a4ff7c830133c0262f1198539b06b3.png)

Then just run whatever animation logic you have on the hand sprite rather than the background.

---

<div class="post-metadata">

**Author:** ![awdrgyjil](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/awdrgyjil/32/20926_2.png) [@awdrgyjil](https://forum.makecode.com/u/awdrgyjil)\
**Post date:** [July 26, 2024, 5:02pm UTC](https://forum.makecode.com/t/can-you-put-a-background-in-front-of-raycasting/29832/3 "2024-07-26T17:02:21Z")

</div>

you should make the gun into a sprite that is relative to screen so that it is above the tiles, it will fix the problem

---

<div class="post-metadata">

**Author:** ![ollie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ollie/32/16530_2.png) [@ollie](https://forum.makecode.com/u/ollie)\
**Post date:** [July 28, 2024, 4:18am UTC](https://forum.makecode.com/t/can-you-put-a-background-in-front-of-raycasting/29832/4 "2024-07-28T04:18:31Z")

</div>

Thanks for all the help my friends kept asking why it was happening 😁😃
