# Making a ray gun

**URL:** <https://forum.babylonjs.com/t/making-a-ray-gun/11912>\
**Category:** Questions\
**Created:** [June 22, 2020, 4:55pm UTC](https://forum.babylonjs.com/t/making-a-ray-gun/11912 "2020-06-22T16:55:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ignite](https://avatars.discourse-cdn.com/v4/letter/i/34f0e0/32.png) [@ignite](https://forum.babylonjs.com/u/ignite)\
**Post date:** [June 22, 2020, 4:55pm UTC](https://forum.babylonjs.com/t/making-a-ray-gun/11912/1 "2020-06-22T16:55:01Z")

</div>

I was looking at [this playground](https://playground.babylonjs.com/#UK6WTT#2) and I want to add a feature much like this ray gun to my game. My only problem with this is that the lightning very clearly appears to be 2D because it uses a plane. Is there any way to add more “depth” to it to make it look 3D. I’m just looking at being able to fire a glowing ray from my weapon, so I am open to alternate methods for achieving a similar effect as well. Thank you.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [June 22, 2020, 4:57pm UTC](https://forum.babylonjs.com/t/making-a-ray-gun/11912/2 "2020-06-22T16:57:31Z")

</div>

I guess you have to create your own shader in node material for instance and why not use a cylinder instead ???

[https://doc.babylonjs.com/how\_to/node\_material](https://doc.babylonjs.com/how_to/node_material)

You have plenty of nice videos from @PirateJC and teams in the doc to help in the process.

---

<div class="post-metadata">

**Author:** ![ignite](https://avatars.discourse-cdn.com/v4/letter/i/34f0e0/32.png) [@ignite](https://forum.babylonjs.com/u/ignite)\
**Post date:** [June 22, 2020, 5:08pm UTC](https://forum.babylonjs.com/t/making-a-ray-gun/11912/3 "2020-06-22T17:08:31Z")

</div>

Sorry if my question seems basic, I am very new to babylon and game dev in general. I did consider using a cylinder but the lightning-like effect of the playground seemed really cool and I wanted to do something similar if possible. I will check out the node editor. Thank you for your reply.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [June 22, 2020, 5:47pm UTC](https://forum.babylonjs.com/t/making-a-ray-gun/11912/4 "2020-06-22T17:47:48Z")

</div>

> [@Examples from the playground](https://forum.babylonjs.com/t/examples-from-the-playground/3175/490):
>
> [https://www.babylonjs-playground.com/#U4U5QF#15](https://www.babylonjs-playground.com/#U4U5QF#15) Blast Away, lots of moving parts of an SPS here. Stoked I was able to redig this one up, really thankful for the playground search, or I would lose a lot of my examples. [https://playground.babylonjs.com/#CMS27E#8](https://playground.babylonjs.com/#CMS27E#8) \<- The system attached to a simple aiming/targeting AI.

This might help.

---

<div class="post-metadata">

**Author:** ![ignite](https://avatars.discourse-cdn.com/v4/letter/i/34f0e0/32.png) [@ignite](https://forum.babylonjs.com/u/ignite)\
**Post date:** [June 22, 2020, 5:51pm UTC](https://forum.babylonjs.com/t/making-a-ray-gun/11912/5 "2020-06-22T17:51:20Z")

</div>

Thank you! these playgrounds are incredibly helpful.
