Download

[4.17.2] Remove Lag from Custom Mouse Cursor? (resolved)

Ive made a Custom Mouse Pointer for my project.
I implement it by Creating it as a Widget Object from the player controller in C++:



    //Create Cursor Visual
    OrtCursor = CreateWidget<UUserWidget>(this, OrtCursorClass);
    if (OrtCursor)
    {
        UPanelWidget* RootWidget = Cast<UPanelWidget>(CurrentCursorPanel->GetRootWidget());
        if (RootWidget) RootWidget->AddChild(OrtCursor);
    }

I move it onto the current mouse position in the tick of the Widget Blueprint of the Cursor.
Ive noticed that if I move the mouse swiftly enough, or if the game is laggy enough, the Custom Mouse Pointer Widget lags behind the actual mouse position.

Am I implementing this incorrectly?
How can ensure the Custom Mouse Pointer Widget is always at the current mouse position, regardless of how fast I move the mouse or how laggy the game is?

EDIT:
Im not sure if I should post this here or in the Blueprint Scripting forum…

this is why custom hardware cursor is a feature request for a long time…

You can already specify custom Hardware and Software cursor widgets in project settings, without the need to do something like this.

I added my Cursor widget to the “Software Cursors” list, but it did not show.
What else do I need to do to get it to work?
Is there something specific I have to set in the widget?

For Software Cursors you need to create some kind of Input Preprocessor for Slate I believe.

Nick has an example project with a ‘Virtual Cursor’ here: [Example] Virtual / Analog Cursor in UMG/Slate (Destiny Style) - C++ Gameplay Programming - Unreal Engine Forums

Nevermind, turns out I had some “bShowMouseCursor”, and DefaultMouseCursor = EMouseCursor::None" shenanigans going on in my code.
Simply setting Software Cursors to my custom widget did actually do the job.