# Shooting projectiles in random directions when mouse cursor overlaps player?

**URL:** <https://forums.unrealengine.com/t/shooting-projectiles-in-random-directions-when-mouse-cursor-overlaps-player/485514>\
**Category:** World Creation\
**Tags:** direction, unreal-engine, twin-stick, Physics, top-down, projectile, question\
**Created:** [June 29, 2021, 1:13am UTC](https://forums.unrealengine.com/t/shooting-projectiles-in-random-directions-when-mouse-cursor-overlaps-player/485514 "2021-06-29T01:13:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [June 29, 2021, 9:55am UTC](https://forums.unrealengine.com/t/shooting-projectiles-in-random-directions-when-mouse-cursor-overlaps-player/485514/4 "2021-06-29T09:55:44Z")

</div>

> The projectile usually hits the ground  
> underneath the player

`Get Hit Result Under Cursor` hits the floor - so you’re attempting to shoot at the floor. Either add Z offset to the hit location or use a method that does not revolve around getting hits from level geometry:

> [@Line Trace from a 3d point to mouse location](https://forums.unrealengine.com/t/line-trace-from-a-3d-point-to-mouse-location/237661):
>
> I’m making a 3d side-scroller game and I want to do a line trace from the character glasses to wherever I click on the screen with the mouse. I want this trace to stay on the same plane as my character, so the X value of the start point & end point should be the same. This is the best I could do, but it’s not accurate - When I click roughly in the center of the screen the trace is pretty accurate, but when I click further away from the center it gets less and less accurate…So…What am I doing w…

In your case you’d use 0,0,1 as Normal and place the plane at gun height.

* * *

But to be honest, it all depends how you want it to work. Do we always shoot at the same level? What if the enemy is higher / lower than us?

---

_[View the full topic](https://forums.unrealengine.com/t/shooting-projectiles-in-random-directions-when-mouse-cursor-overlaps-player/485514)._
