# Why is my line trace flickering? seems to be colliding or z-fighting with the mouse cursor

**URL:** <https://forums.unrealengine.com/t/why-is-my-line-trace-flickering-seems-to-be-colliding-or-z-fighting-with-the-mouse-cursor/1396577>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [November 17, 2023, 4:51am UTC](https://forums.unrealengine.com/t/why-is-my-line-trace-flickering-seems-to-be-colliding-or-z-fighting-with-the-mouse-cursor/1396577 "2023-11-17T04:51:28Z")\
**Posts on this page:** 1\
**Showing post:** 23

<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:** [November 17, 2023, 10:30am UTC](https://forums.unrealengine.com/t/why-is-my-line-trace-flickering-seems-to-be-colliding-or-z-fighting-with-the-mouse-cursor/1396577/23 "2023-11-17T10:30:21Z")

</div>

> [@fael097](#):
>
> I guess the cone would ideally only limit it up and down since you still have freedom to turn around in a top down game.

At a great personal risk of sounding _cocky_ - I am not convinced if that’s what you _really_ want. (do correct me if I’m wrong, though!). The idea is not to limit what the player can do but when then can do it. Since shooting is usually based one the facing direction, see if that’d work for you:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/8/7c869a2a24adbe16459f39598c6a91c43a5d37e0.jpeg)

Once the character turns, they will be able to shoot in the facing direction again, ofc. If you’re making a twin-stick shooter (or mechwarrior / tank -style) type of movement and rotation, this would also work because you’d be working with the forward vector of the upper body or weapon.

We’ve yet to see how the movement is supposed to work here, so I might be waaaay off with my assumptions. But judging by the anim in the first post, you’re already rotating towards the hit rotation - so this could be fine as is.

* * *

> I’ll have a think - haven’t seen this done

Somehow I imagined something more elaborate. It’s just a [dot product](https://forums.unrealengine.com/t/how-to-create-god-of-war-targetting-system/210302/2) ← cool example.

---

_[View the full topic](https://forums.unrealengine.com/t/why-is-my-line-trace-flickering-seems-to-be-colliding-or-z-fighting-with-the-mouse-cursor/1396577)._
