# How to fire projectile from skeletal mesh socket to crosshair in third person?

**URL:** <https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517>\
**Category:** World Creation\
**Tags:** unreal-engine, projectile, question\
**Created:** [July 6, 2014, 7:30am UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517 "2014-07-06T07:30:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyborgjynx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cyborgjynx](https://forums.unrealengine.com/u/cyborgjynx)\
**Post date:** [July 6, 2014, 7:30am UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517/1 "2014-07-06T07:30:09Z")

</div>

I have been using the third person template so far, and I’m trying to get the player to shoot at the mouse location. Think of any third person/over the shoulder games where the player can fire weapons (Last of Us, Watch Dogs, Infamous, etc). I’m close, but the aim is off by a bit. Here’s what I’ve done so far:

- I’m using Owen from the content examples (the one where you possess him) but in a third person template. I imported that pawn and am using him instead of the blue-ish mannequin guy.
- I am using the LeftHandSocket as the projectile spawn point in Owen’s skeletal mesh.
- Projectile velocity is x = 1, y = 0, z = 0 with no gravity.
- Crosshair at center of viewport.

I spawn the projectile by left clicking in the character blueprint at the socket’s location + a forward vector and at the rotation of Get Control Rotation node. The projectile is will travel in the same relative direction the camera is facing, and hit somewhat close to whatever the crosshair is pointing at but a little to the left. I feel like I’m missing something simple, but I’ve watched all of the tutorials I can find. I’ve looked at all of the sample projects like the Shooter Game, but that’s in c++. I’m doing this in blueprint only.

I hope someone can point me in the right direction.

---

<div class="post-metadata">

**Author:** ![cyborgjynx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cyborgjynx](https://forums.unrealengine.com/u/cyborgjynx)\
**Post date:** [July 6, 2014, 9:57pm UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517/2 "2014-07-06T21:57:23Z")

</div>

I made some headway and think I have it figured out. If there’s an easier way or more efficient way, please post it!

I did all of this in the Third Person Template, but I used Owen from the content examples (I migrated him from Content Examples). It would probably work with the default mannequin guy as well, but I haven’t tested that. Here’s what I did (sorry if it’s grainy):

 ![9718-thirdpersonshoot.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/b/32b3160ddb1f36d9f8ec95096d9a90f182674e1f.jpeg)

The event to in the image is just the Left Mouse Button (I have it set in the project setting’s input panel as shoot). The projectile I have set up is the same from the first person shooter template (velocity only in X direction, initial speed of 2000, but with no gravity so it will fly straight).

Basically, you have to do a trace from mouse world location to 20000 units forward. That 20000 may be way too big, but it will ensure the trace hits something. If the trace hits nothing, the projectile will fire at the last item that was hit. Then using the location from the break hit result, find the look at rotation between spawn point of projectile and this hit location. I have my crosshair in middle of the screen by the way.

When you spawn the projectile, the location is the your spawn location you need to set up before hand and the rotation is the result of the find look at rotation node. For the spawn position, I spawned my projectile at the desired location \* 100 units forward. My spawn position is Owen’s RightHandSocket. Note that the 100 forward is not simply 100 units in x world location, but 100 units forward from whatever direction you are facing.

To actually see the line trace, select an option from the drop down box in the Single Line Trace by Channel node.

I hope this helps someone!

---

<div class="post-metadata">

**Author:** ![RedLine](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RedLine](https://forums.unrealengine.com/u/RedLine)\
**Post date:** [November 23, 2014, 9:58pm UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517/3 "2014-11-23T21:58:35Z")

</div>

This interests me! Is there a way you could upload a sharper/larger image? it’s just to grainy for me to make out. Cheers!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_113314df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_113314df](https://forums.unrealengine.com/u/anonymous_user_113314df)\
**Post date:** [January 9, 2015, 11:32am UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517/4 "2015-01-09T11:32:21Z")

</div>

Hello,  
ca you help me by uploading a larger image, please.

---

<div class="post-metadata">

**Author:** ![Tone](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tone](https://forums.unrealengine.com/u/Tone)\
**Post date:** [January 18, 2015, 6:29am UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517/5 "2015-01-18T06:29:46Z")

</div>

There is also a get socket transform function that allows you to choose what socket you want to spawn from 🙂

---

<div class="post-metadata">

**Author:** ![juniortan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@juniortan](https://forums.unrealengine.com/u/juniortan)\
**Post date:** [May 5, 2015, 3:47pm UTC](https://forums.unrealengine.com/t/how-to-fire-projectile-from-skeletal-mesh-socket-to-crosshair-in-third-person/287517/6 "2015-05-05T15:47:17Z")

</div>

Hope this helps

> **[ThirdPerson fire Projectile, trace to sky](https://forums.unrealengine.com/questions/222735/thirdperson-aim-at-sky.html)**
>
> So I have been playing with the thirdperson template and added quite a few things. But there’s one thing I couldn’t figure out how to fix, which is Shooting Projectile while Aiming at the sky. I have recorded a short clip demonstrating the issue I...
