# How to have a 2D object in raycasting

**URL:** <https://forum.makecode.com/t/how-to-have-a-2d-object-in-raycasting/18207>\
**Category:** Help\
**Created:** [March 1, 2023, 5:51am UTC](https://forum.makecode.com/t/how-to-have-a-2d-object-in-raycasting/18207 "2023-03-01T05:51:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixel/32/7602_2.png) [@pixel](https://forum.makecode.com/u/pixel)\
**Post date:** [March 1, 2023, 5:51am UTC](https://forum.makecode.com/t/how-to-have-a-2d-object-in-raycasting/18207/1 "2023-03-01T05:51:44Z")

</div>

So I’ve been working on this shooter game, and I wanted to make a gun on the side, which looks like what you usually see in FPS games. Except that the gun would just become 3D, and I can’t make it become 2D. Any solutions to this?

- pixel

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [March 1, 2023, 11:19pm UTC](https://forum.makecode.com/t/how-to-have-a-2d-object-in-raycasting/18207/2 "2023-03-01T23:19:19Z")

</div>

Could you show a picture of what you meant or a reference. Because that explanation was kinda hard to understand

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [March 1, 2023, 11:19pm UTC](https://forum.makecode.com/t/how-to-have-a-2d-object-in-raycasting/18207/3 "2023-03-01T23:19:40Z")

</div>

my Halo-Doom is a good example to look at, although it might be outdated. Maybe you can scroll down to one of AqeeAqee’s posts where he edited it with the new raycasting extension.

[Introducing… Halo-Doom/Wolfenstein3D (But I’ll call it Halo-Doom)! - Arcade / Show & Tell - Microsoft MakeCode](https://forum.makecode.com/t/introducing-halo-doom-wolfenstein3d-but-ill-call-it-halo-doom/12325)

---

<div class="post-metadata">

**Author:** ![Unique](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unique/32/32724_2.png) [@Unique](https://forum.makecode.com/u/Unique)\
**Post date:** [March 1, 2023, 11:43pm UTC](https://forum.makecode.com/t/how-to-have-a-2d-object-in-raycasting/18207/4 "2023-03-01T23:43:18Z")

</div>

Just use the relative to camera block on the sprite you wish to use!

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/e/e42686cb50936b84d89322b3d11482ffcb4bb1eb.png)
