# Sidescroller Aim Direction Vector from Location and Angle

**URL:** <https://forums.unrealengine.com/t/sidescroller-aim-direction-vector-from-location-and-angle/328890>\
**Category:** Community & Industry Discussion\
**Tags:** sidescroller, aiming, unreal-engine, question\
**Created:** [August 16, 2015, 7:06pm UTC](https://forums.unrealengine.com/t/sidescroller-aim-direction-vector-from-location-and-angle/328890 "2015-08-16T19:06:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kilrogg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kilrogg](https://forums.unrealengine.com/u/Kilrogg)\
**Post date:** [August 16, 2015, 7:06pm UTC](https://forums.unrealengine.com/t/sidescroller-aim-direction-vector-from-location-and-angle/328890/1 "2015-08-16T19:06:22Z")

</div>

I feel like there’s an easy answer to this but I’m having a major brain fart as to how to solve this specific problem.

I have a sidescroller where the character can only face/go to the right. I’ve setup the aiming using a sphere on the character, which I rotate based on the LookAt rotation from the sphere to the mouse (in order to get the proper angle for the up/down aimspace in my animblueprint). I’ve capped this angle to -70/+70 so that you can’t aim left or too high/low.

So now I know the angle at which I’m aiming, as shown below.

![54381-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/e/94e7e0e8ef79d266f0e9b8df43976833b9209152.png)

What I’m trying to do now is fire a projectile in the direction I’m aiming. I have a socket at the tip of my gun where I want to shoot from, so I know my start vector.

How do I get the direction vector of where my gun is aiming?

Thanks!

---

<div class="post-metadata">

**Author:** ![Kilrogg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kilrogg](https://forums.unrealengine.com/u/Kilrogg)\
**Post date:** [August 17, 2015, 2:05am UTC](https://forums.unrealengine.com/t/sidescroller-aim-direction-vector-from-location-and-angle/328890/2 "2015-08-17T02:05:23Z")

</div>

So as I expected, the answer was rather simple:

Since I’m rotating up/down the weapon along with the character and that’s what I want to fire from, I just had to get the weapon’s rotation and GetForwardVector on it to get the direction vector.

---

<div class="post-metadata">

**Author:** ![MADB.RUSH](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MADB.RUSH](https://forums.unrealengine.com/u/MADB.RUSH)\
**Post date:** [September 12, 2020, 11:47pm UTC](https://forums.unrealengine.com/t/sidescroller-aim-direction-vector-from-location-and-angle/328890/3 "2020-09-12T23:47:36Z")

</div>

3D sidescroller shooting in angles WITHOUT a mouse.

Hi guys, I’ve been searching on the web for the answer for months but I haven’t been successful.  
The question is simple, but the answer seems to be something sacred and very difficult to find.

OK, let’s go …

How can I create a script of mechanics similar to Bass or Axel (from Megaman) from sidescroller 3d shooting game? How to make a 3D sidecroller character shoot at angles or aim WITHOUT a mouse.

All the answers I found on the internet is about to aim using mouse location, but in my project the player will not use the mouse. Only the keyboard or gamepad.

I want to make my character shoot or aim at + and - 45 degrees to the left, right, up and down using only the gamepad’s directional movement control with a aim button (like LT + directional button to aim and X to shoot)

The question seems to be simple, but the answer just doesn’t exist!

I need your help and thanks so much for the time wasted to give a little attention to my task!
