# how to spawn projectile from weapon using sockets

**URL:** <https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079>\
**Category:** Blueprint\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, unreal-engine, crash, Physics, bug-report, editor, question, Blueprint, CPP, fab, fortnite\
**Created:** [September 12, 2025, 3:02pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079 "2025-09-12T15:02:52Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dozzirik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dozzirik](https://forums.unrealengine.com/u/Dozzirik)\
**Post date:** [September 12, 2025, 3:02pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/1 "2025-09-12T15:02:52Z")

</div>

hello all. i have two weapon. i want to spawn projectile from my weapons. first i want to add socket.i will use ray to crosshair. and my bullets will go to that direction. thank your for helps

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/8/4b8f2b24a76a081fcc93d26bcf2887e8e4171e6c.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/d/eed0f9e091e68a935347667f1c40c8cd98226fd8.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/4/d1495d13d628abedc29f306973d4c9be4a0180ff.jpeg)

---

<div class="post-metadata">

**Author:** ![Hdubs37](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdubs37/32/88714_2.png) [@Hdubs37](https://forums.unrealengine.com/u/Hdubs37)\
**Post date:** [September 12, 2025, 5:43pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/2 "2025-09-12T17:43:54Z")

</div>

Hello.

I did not understand what you’re trying to do ? I don’t get your drawing, can you detail a bit more how you want to calculate the direction ?

---

<div class="post-metadata">

**Author:** ![illspiritx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illspiritx](https://forums.unrealengine.com/u/illspiritx)\
**Post date:** [September 12, 2025, 10:59pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/3 "2025-09-12T22:59:37Z")

</div>

If your crosshair is centered on the screen, line trace from camera and use the hit location (or Trace End if it misses) and find lookatrotation for spawning projectile class.

 ![bulletyspawn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/d/0ad08d4321e88e338b352dba3fee8aa2f581d218.jpeg)

For the socket location there, I used a mesh (called WeaponM in teh bp) attached to char’s hand which has its own muzzle socket. IF you char mesh has the guns baked in, add the socket to the characters skeletal mesh and get socket location from that.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [September 12, 2025, 11:25pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/4 "2025-09-12T23:25:22Z")

</div>

No need to do a trace for shooting a projectile from a muzzle location toward center screen.

Variables and MATH.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/6/b/e6bf04131a7ebdf49c61af375e915014c0aaae91.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/7/167762ea6e7b8d19a68075e33e080cdd97d8e572.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/5/1b501554ee0ad5ace39176521c9e97a09191f52d.png)

* * *

In the projectile class create a vector variable `ProjectileSpeed` set it to Instance Editable and Exposed on spawn.

In the construction script take PMC and Set Velocity

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/e/c2e0787235e8e747184b39323fcf5853655dd0f8.png)

* * *

Pass `Aim Velocity` to the spawn actor of class node for your projectile.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/5/8f52f24e851d771fd2978d85adbb72c21cfcba37.png)

---

<div class="post-metadata">

**Author:** ![illspiritx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illspiritx](https://forums.unrealengine.com/u/illspiritx)\
**Post date:** [September 13, 2025, 1:54am UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/5 "2025-09-13T01:54:50Z")

</div>

That works well when the camera is mostly horizontal, but when using camera forward _\* some arbitrary float, weird things can happen when aiming high or low. Like if aiming at the top edge of a wall, the crosshairs could be on wall while cam forward_\*2000+loc could be over and behind the wall in Ohio somewhere. Linetrace from camera pretty much assures you’r hitting what’s in the center of the screen. And as an added bonus, one could use the hit actor result to fire off interfaces functions or something on target to warn them if need be. EG, with a slow projectile, or shooting at Neo from the Matrix one might want AI to consider trying to dodge.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [September 13, 2025, 2:29am UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/6 "2025-09-13T02:29:03Z")

</div>

I use it all the time. It’s 100% deadeye to whatever I’m aiming at. Works 100% with Aim Offset as well.

---

<div class="post-metadata">

**Author:** ![Dozzirik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dozzirik](https://forums.unrealengine.com/u/Dozzirik)\
**Post date:** [September 15, 2025, 7:45am UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/7 "2025-09-15T07:45:37Z")

</div>

I don’t have a separate weapon. The weapon is attached to the skeleton. So how can I get the socket’s location? I added sockets to the ends of both weapons using the “add socket” command. I want to use these locations in my blueprint. thank you for helps i ll use that math later

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/8/958545c6d9d102ddc182c9743041fcb81984a47c.jpeg)

---

<div class="post-metadata">

**Author:** ![Dozzirik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dozzirik](https://forums.unrealengine.com/u/Dozzirik)\
**Post date:** [September 15, 2025, 8:52am UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/8 "2025-09-15T08:52:29Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/f/6cf6eb5b5f477d23ad54067aa478d7b541fd665b.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/b/30b57df030f38f2b60982bed6f44b5ad9f690f27.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/b/28bb686c580e0404db9eeaa80515e362eafef7a7.png)whats wrong here. maybe my socket location? i need to shoot from 2 weapon btw

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/c/79c789e686ce7d8cd2a35c73e661c8aab4d72016.jpeg)

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [September 15, 2025, 6:58pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/9 "2025-09-15T18:58:26Z")

</div>

If I remember correctly here, the easiest way to do this is to make your projectile bp, add a projectile movement component (turn gravity off it you don’t want it to drop).

And then place your socket on the weapon. When you go to fire spawn actor at location, choose the socket, and plug in your rotation and then it should be right.

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [September 15, 2025, 7:20pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/10 "2025-09-15T19:20:49Z")

</div>

Use `get socket location` and pass that vector as the spawn location.

---

<div class="post-metadata">

**Author:** ![illspiritx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illspiritx](https://forums.unrealengine.com/u/illspiritx)\
**Post date:** [September 15, 2025, 11:53pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/11 "2025-09-15T23:53:18Z")

</div>

Dunno why the projectiles are doing that without seeing the whole function. Socket looks fine tho, To fire with both guns, you could do somethign like this on the input action event that calls the shooty function:

 ![gunfu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/a/7aad44d1d11c7d96a412cb4f8ebb5412d49ddf81.jpeg)

In the shoot start function,I added a name input, and when spawning projectiles, I get the socket name local var from the input to feed the get socket location command:

 ![spawnprojectile](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/2/ea2090f46678273b3b46198669b682b92e61664d.jpeg)

Doing it like this would alternate fire between the two guns.. Could be a headache to track ammo, but, yea.

---

<div class="post-metadata">

**Author:** ![Dozzirik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dozzirik](https://forums.unrealengine.com/u/Dozzirik)\
**Post date:** [September 16, 2025, 9:24am UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/12 "2025-09-16T09:24:19Z")

</div>

thank youu it works. now i need to rotate my weapons towards crosshair bro

---

<div class="post-metadata">

**Author:** ![Dozzirik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dozzirik](https://forums.unrealengine.com/u/Dozzirik)\
**Post date:** [September 16, 2025, 9:25am UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/13 "2025-09-16T09:25:08Z")

</div>

thank u sir

---

<div class="post-metadata">

**Author:** ![Dozzirik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dozzirik](https://forums.unrealengine.com/u/Dozzirik)\
**Post date:** [September 17, 2025, 3:38pm UTC](https://forums.unrealengine.com/t/how-to-spawn-projectile-from-weapon-using-sockets/2656079/14 "2025-09-17T15:38:07Z")

</div>

i have new question. when i aim up a bit more bullet going wrong.
