How to dynamically change mouse cursor?

How to change mouse cursor in game? Let’s say I want to change my cursor to crosshair when hovering over an enemy, to door icon when hovering over a door, etc…
I can’t find any info about that besides pre-setting the cursor in project settings.

1 Like

Bumpy bump ^^

Super Bump from the future.

You make a HUD that draws an image on the position of your cursor. You can set that image to be whatever you want based on any condition you want.

1 Right Click in the Content Browser, select Blueprint Class and create a UserWidget.

2 Go to Edit>Project Settings

113929-wid2.jpg

3 Go to User Interface and set your UserWidget as Default Cursor (I had called mine “BP_Cursor”)

4 Open your UserWidget Blueprint and add a custom image.

5 Go to Graph Editing and manage your interactions from there. As an example, below I’m ticking the player pawn waiting for changes in the “Cursor State” Integer variable and changing the image’s colour in response to that.

6 Likes

Thank you for the answer! +1

… Now let’s hope for hardware cursor some day… :slight_smile:

Thank’s EminorReal, cool solution.

These cursor settings in Project Settings don’t exist anymore.
But the same thing works as Software Cursor, creating map elements.

Duuude. iv trying so hard to solve this, casting from it or to it, set cursor nodes, widget components and etc etc etc. it would always either ignore the code or give me errors.
Amazing solution!