Custom hardware cursor doesn't work in packaged project

I love to make game with UE4 so much, and I’d like to make it better with UE users and developers. I’m making a game which I think a custom hardware cursor is necessary.
I make a UWG and set hardware cursor in Project Settings → User Interface → Hardware Cursor, all goes well but, it becomes the Windows native cursor in the packaged project.


Then I read the source code of UE4 roughly, and set breakpoint and check the call stack, and I found the class FWindowsCursor only called in constructor of class FWindowsApplication(derived from GenericApplication) which is created by FSlateApplication. I have poor knowledge about this framework and what FSlateApplication is, and I’m not a native English speaker, I 'm confused with the term “Slate”. Upon the above analysis, I reached the conclusion that the hardware cursor only take effect when the game is running in the small view port of UE4 editor, is there any problem?


When my solution configuration changed into DebugGame, it works. But symbols of WindowsCursor.cpp are not loaded. I don’t know anything can help, I just state what I did and what I obseved.


All right, is there any mature solution about this? I’m not giving up. A custom hardware cursor is still in my wishing list.
Thanks a lot in advance.


I tried to use Windows lib functions such as LoadImage and SetCursor to make it, but the cursor change into native one as soon as I move my mouse. And, of course, it doesn’t work in packaged project.

Did you check if your cursor images are being packaged? I read somewhere that putting them inside a directory called Slate means they’re automatically picked up for packages. Otherwise you might need to add the directory in which you’re storing them to the list of locations to package.

Oh god! It works! I put my cursor images in folder content/slate and modify cursor path in User Interface as what you said.

Here’s what you a discernment man said!

1 Like

Do you have any idea about why cursors sometimes still perform the native styles when the game loads? My custom cursor shows after I switch into some other windows and refocus the game windows.

I found the issue here https://answers.unrealengine.com/questions/697686/setting-a-custom-hardware-cursor-does-not-work-unl.html , thanks a lot for your answer!