Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [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++:

    Code:
        //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...
    Last edited by Erdrik; 10-25-2017, 06:59 AM.

    #2
    this is why custom hardware cursor is a feature request for a long time...
    Edge of Chaos RTS
    "Age of Total Heroes" - RTS Pathfinding and Movement System for UE4
    RTS Camera C++ Tutorial

    Comment


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

      Comment


        #4
        Originally posted by TheJamsh View Post
        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?

        Comment


          #5
          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: https://forums.unrealengine.com/deve...-destiny-style

          Comment


            #6
            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.

            Comment

            Working...
            X