# click event not working properly - mouse offset ?

**URL:** <https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378>\
**Category:** Programming & Scripting\
**Tags:** click, click-event, unreal-engine, mouse\
**Created:** [April 1, 2025, 12:30pm UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378 "2025-04-01T12:30:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoomvp.at](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zoomvp.at](https://forums.unrealengine.com/u/zoomvp.at)\
**Post date:** [April 1, 2025, 12:30pm UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/1 "2025-04-01T12:30:50Z")

</div>

Hi,

I’m starting fresh as a newbie with a new game and trying to get a few basic things up and running.

1. I enabled click events in the level BP.
2. I created a BP actor with a static mesh and an on-click event, using a print string to see the result.

**In play mode, clicking on the actor sometimes (or only in a specific area) triggers the event. In some cases, even clicking outside of the actual mesh works.**

 ![click_event_not_working_properly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/8/2f8ce86a48969fe723b5e844e70e5e0ba9e0de85.jpeg)

Unfortunately, this issue is also happening with the mouse-over events. I would appreciate your help.

Thanks!

---

<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:** [April 1, 2025, 12:50pm UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/2 "2025-04-01T12:50:59Z")

</div>

> [@zoomvp.at](#):
>
> I enabled click events in the level BP.

Just to clarify, in LB, on Begin Play, you enabled click / hover events of the Player Controller, right?

* * *

> [@zoomvp.at](#):
>
> In play mode, clicking on the actor sometimes (or only in a specific area) triggers the event. In some cases, even clicking outside of the actual mesh works.

The only thing that comes to mind is collision. Either of that cube or of something else that sits between the camera and the cube and intercepts the clicks. In the editor viewport, outside of PIE (Play in Editor), press Alt+C to visualise collision - how does it look?

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

---

<div class="post-metadata">

**Author:** ![zoomvp.at](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zoomvp.at](https://forums.unrealengine.com/u/zoomvp.at)\
**Post date:** [April 1, 2025, 2:40pm UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/3 "2025-04-01T14:40:26Z")

</div>

Hi.

Thank you so much. The trick with the collision helped. 😃  
I had an other invisible object close to the clickable object. Shame on me. 🫢

It is still not working on the whole static mesh but way better then before.

Thank you! 👍

---

<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:** [April 1, 2025, 3:17pm UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/4 "2025-04-01T15:17:55Z")

</div>

> [@zoomvp.at](#):
>
> It is still not working on the whole static mesh but way better then before.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/3/9a3de1b4a94c227e2637062d1ee66cc9f261c794.png)

Try this and see what it Prints when you click the mesh and it does not work.

---

<div class="post-metadata">

**Author:** ![zoomvp.at](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zoomvp.at](https://forums.unrealengine.com/u/zoomvp.at)\
**Post date:** [April 2, 2025, 8:13am UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/5 "2025-04-02T08:13:20Z")

</div>

Thank you for your quick and very helpful response.  
Even for me, it was simple to rebuild this easy BP. 🙂

It seems that the cursor location is based on its actual position on the screen when starting the game. I tried to center the cursor as shown in this video:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/1/6b190adb59ebe29b4795a9df685793067f318df1.jpeg "How to spawn the Mouse to Center of the viewport - Unreal Engine 5") ](https://www.youtube.com/watch?v=ZIjTN7Sb3ds)

But now the cursor is at the top left of the screen, which is the same issue as mentioned in the comment under the video. So I disabled the code again.

I tried to start the game with the cursor in the middle of the crosshair. Here, I noticed that the cursor seems to move faster or slower than the viewport change/camera view, or it might be offsetting? I’m not sure about that.

 ![click_on_actor_calls_wrong_actor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/2/a5238c973556618fae70dc23e868915676489dbc.jpeg)  
The crosshair is pointing at the wooden sheets (BP to open the menu), but the click actually refers to the furniture to the left/below it.

Thank you so far.

---

<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:** [April 2, 2025, 8:40am UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/6 "2025-04-02T08:40:24Z")

</div>

I do not understand what cursor positioning has to do with any of it. Are you trying to select / highlight elements that are in the centre of the screen? If so, using a cursor is not the way to do it. It will introduce lag and many other inconsistencies.

* * *

It’s a matter of a simple manual trace instead. Could you clarify? Especially the bit about the cursor / screen centre:

- is the user expected to move the cursor separately from the camera?
- or is the “cursor” merely a visual indicator of where the screen centre is and we pick items following camera’s forward vector? (like in many 1st person perspective games)

---

<div class="post-metadata">

**Author:** ![zoomvp.at](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zoomvp.at](https://forums.unrealengine.com/u/zoomvp.at)\
**Post date:** [April 2, 2025, 9:19am UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/7 "2025-04-02T09:19:20Z")

</div>

Yes, I try to select/highlight elements that are in the center of the screen.  
The user is not supposed to move the cursor separately from the camera.

My actual goal is to build a VR game in which you can open a menu and press buttons without any input other than looking at a specific point for a certain amount of time. (“On Hovered event” with a timer?)  
For demo purposes, and due to not having a working VR setup right now, I’ve set it up as a first-person-game.

I started with a click instead of hovering over for ease of use.  
I already tried this great tutorial that relies on “Line Trace by Channel.”

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/3/873ba29f6920babcb7308c4da95f05253f95554c.jpeg "Change Crosshair Colour For Enemy, Teammate and Neutral - Unreal Engine 4 Tutorial") ](https://www.youtube.com/watch?v=jJbYr7eqd4I&t=410s)

It didn’t work at first, so I tried a different approach (click events and so on).  
I think I need to dive deeper into this. I will follow this video again and see if it gets me to the desired solution.

Thank you so far.

---

<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:** [April 2, 2025, 9:23am UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/8 "2025-04-02T09:23:17Z")

</div>

Do consider the standard trace + interface combo for this:

> [@Moving an object by pointing another object at it](https://forums.unrealengine.com/t/moving-an-object-by-pointing-another-object-at-it/1657869/2):
>
> See if this point_down helps with this point_up_2 particular bit. a standard forward camera trace: You’d use an interface or inheritance if there are more types to handle, ofc. not sure how you want stuff to move, here it’s via a timeline: which results in: the branches in the script prevent it from spamming since we’re tracing on Tick: Hopefully you can adapt it to your needs. It’s a setup similar to this one:

Another one:

> [@Third person crosshair object highlight troubles](https://forums.unrealengine.com/t/third-person-crosshair-object-highlight-troubles/252041/13):
>
> The communication in the example revolves around Inheritance + Interface - a potent combo, imho. the base class implements the interface (which children inherit) the widget uses the same interface - calls children receive can be propagated: Actor → Widget Component → Widget without casting or finding user widgets (this can be done in many ways, though) the player has a collision sphere and sends an interface call to overlapped actors as we approach: [image] [image] Above, handl…

This one has an example project attached.

* * *

There’s, of course, tons of tut on this:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/a/feacf6e0dd4aa49403851495d4883725fa99ef34.jpeg "How To Select (Highlight) Other Actors/Objects By Looking At Them In Unreal Engine 5") ](https://www.youtube.com/watch?v=R7oLZL97XYo)

Since this is one of the more common interactions.

* * *

The gist is that you trace using a camera forward vector. The crosshair is just a visual reference. You should not use a mouse cursor, especially considering the VR implementation where there is a very different pointing device.

---

<div class="post-metadata">

**Author:** ![zoomvp.at](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zoomvp.at](https://forums.unrealengine.com/u/zoomvp.at)\
**Post date:** [April 2, 2025, 1:41pm UTC](https://forums.unrealengine.com/t/click-event-not-working-properly-mouse-offset/2434378/9 "2025-04-02T13:41:31Z")

</div>

Thank you.

In my game, the line tracing is also a little off…

I’m going to start fresh with a first-person template.  
In this template, the line tracing works as intended. 🙂

I started with an empty game, so just importing the first-person content isn’t working properly.

Thank you very much for helping me out. Game development is completely new to me.
