How to Attach a Widget to the Mouse Cursor in UE5 | 150 SUBSCRIBER SPECIAL
THANK YOU for helping us achieve 150 subscribers! Learn how to attach a widget to your mouse cursor! Special thanks to one of my subscribers, n v, for suggesting this!
This is an Unreal Engine 5 tutorial (might work for UE4) about the three input modes, setting focus and isfocusable nodes, using override functions to capture keyboard input, and putting it all together to make a widget follow or detach from the cursor using three different keyboard input methods:
- simple controller keyboard input (game+ui)
- widget function override keyboard input (ui only)
- widget override-bypass back to controller (ui only)
Chapters:
0:00 Thank you!
0:57 Initial setup
3:12 Input modes
5:33 Widget focus
8:44 Keyboard input
13:01 Attachment positioning
14:58 UI vs Game+UI
16:00 RAINBOW outro
When a component has focus, it can receive input, which you can use to control its behaviour. Understanding INPUT MODES is the key to making this work the way you want.
It can disable or enable keyboard input. It can alter widget focus when the mouse is clicked. Depending on your setup, you can even partially disable the 'absolute' override function despite having focus. Timestamp 7:47.
On a side note, the blueprints I set up can be used as a basic template for executing other commands besides following the cursor. But it's sort of crude so do what you will with this! :D
My videos are inspired by Youtubers such as Dani, Make Games with Katie, Code Bullet, and Sebastian Lague. If you don't know who they are, I highly recommend checking them out!