# Touch Input Doesn't Immediately Update Mouse Position in Custom Drag System (UE 5.4)

**URL:** <https://forums.unrealengine.com/t/touch-input-doesnt-immediately-update-mouse-position-in-custom-drag-system-ue-5-4/2418810>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, touch, Blueprint, question\
**Created:** [March 26, 2025, 2:08pm UTC](https://forums.unrealengine.com/t/touch-input-doesnt-immediately-update-mouse-position-in-custom-drag-system-ue-5-4/2418810 "2025-03-26T14:08:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaopedrovga2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@joaopedrovga2](https://forums.unrealengine.com/u/joaopedrovga2)\
**Post date:** [March 26, 2025, 2:08pm UTC](https://forums.unrealengine.com/t/touch-input-doesnt-immediately-update-mouse-position-in-custom-drag-system-ue-5-4/2418810/1 "2025-03-26T14:08:05Z")

</div>

I’m developing a **custom drag system in UMG** for a **VR/UI project in Unreal Engine 5.4.4**. It works perfectly with **mouse input** , but I’m having issues when using **touch input on a mobile device or touchscreen**.

### **How My System Works (Mouse - Fully Functional)**

1. I have a **main UI widget (WBP\_GaleriaGeral)** containing a **ScrollBox** with dynamically generated buttons ( **WBP\_GaleriaIcon** ).
2. When I **press** a button inside the ScrollBox, a new **image widget (WBP\_ImageDrag)** is **created at the mouse position** and added to the viewport.
3. Inside `WBP_ImageDrag`, there is a **Tick event** that **updates the widget’s position** to follow the mouse **as long as a boolean (`AllowDrag`) is true**.
4. `AllowDrag` is set to **true in Construct and on Mouse Button Down** , and set to **false on Mouse Button Up**.

### **Problem with Touch Input**

- When I **touch a button (WBP\_GaleriaIcon) to create the image widget (WBP\_ImageDrag), the first touch always uses the last known mouse position**, not the actual touch position.
- This means the first spawned `WBP_ImageDrag` **appears in the wrong place** , often far from the touch location.
- I tried overriding **On Touch Started and On Touch Ended** to manually set `AllowDrag = true/false`, just like I do with the mouse, but the issue remains.
- After the first touch, dragging works correctly, meaning that Unreal isn’t recognizing the new touch input as a position update immediately.

### **What I Tried (Without Success)**

1. **Manually setting the mouse position to the touch position** right before creating `WBP_ImageDrag`.
2. **Forcing a “mouse move” event** when touch starts.
3. **Using “Convert Screen Location to World Space”** to update the position before spawning `WBP_ImageDrag`.
4. **Calling “Set Input Mode Game and UI”** when touch starts.
5. **Checking “Use Mouse for Touch”** in Project Settings → Input.

### **What I Need Help With**

- How can I ensure that **the first touch correctly updates the mouse position** before spawning the widget?
- Is there a way to **force Unreal to recognize the touch location immediately** upon pressing?
- Am I missing a step to properly synchronize **touch input and mouse position in UMG**?

Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![rifanif](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rifanif/32/752646_2.png) [@rifanif](https://forums.unrealengine.com/u/rifanif)\
**Post date:** [February 1, 2026, 1:22pm UTC](https://forums.unrealengine.com/t/touch-input-doesnt-immediately-update-mouse-position-in-custom-drag-system-ue-5-4/2418810/2 "2026-02-01T13:22:49Z")

</div>

Hi, I encountered the same problem. The touch input is somehow doesn’t update mouse position immediately in widget bp. However, after some tinkering I found a workaround to resolve this problem. **Inside the press button event** , add some **delay** (I set 0.2s delay) **before trying to get the mouse position**. Using this workaround, the returned mouse position is at the touch location. Hope this helps.
