Forum rules - please read before posting.

Locked Hardware Cursor "jittering"

Hey,
so this happens only when I use hardware cursor, and only if the cursor is "locked" in the middle of screen (3rd person camera), but there is this jitter and slight flickering going on. Any idea why is that happening? Happens in both build/editor.

2017LTS, and latest AC

Here is some gif ( may not be so noticable because of gif quality ) and cursor settings:
https://imgur.com/a/aXO4tLY

Thanks in advance for any tips.

Comments

  • I tried it with clean scene with just AC, changed demo scene to first person and locked cursor on start, and jittering is there too ( I added another gif )

  • Recreated - I shall look into it.

    In the meantime, you may want to consider using Unity UI to render your cursor:
    https://adventure-creator.fandom.com/wiki/Unity_UI-based_cursor

  • Seems this is a Unity Editor issue. I'm not seeing any issues in builds - how about you?

  • Happens for me in both build and in editor, tried in 2017LTS and 2019.3.13f1
    Only if cursor is locked in screen center though - if it is not locked , all is fine.

  • Also, to clarify, it looks better in build - its not blinking on and off - but that slight jittering is still there for me , like small movement by 1 pixel in each direction when I try to move my cursor and its locked. Here is another gif https://imgur.com/Qw3raNJ

  • This may too be a Unity issue, since AC doesn't affect the cursor beyond locking it when in this state.

    Still, it should be possible to find a workaround. I'd still recommend the Unity UI cursor method, but a simpler way may be to check Hide cursor when locked in screen's centre? and just show a separate UI Image component whenever the cursor is locked via custom script:

    using UnityEngine;
    using UnityEngine.UI;
    
    public class LockedCursorReplacement : MonoBehaviour
    {
    
        public Image lockedCursorImage;
    
        void Update ()
        {
            lockedCursorImage.enabled = (Cursor.lockState == CursorLockMode.Locked);
        }
    }
    
  • Hey Chris, thanks! It works for cursor itself, but I also have "change cursor based on interaction" on, so when I interact there are two cursors over each other and the one for interaction is still jumping few pixels randomly.

  • I tried it with the Unity UI script from wiki -
    It is changing cursors as intended - but I came across few problems-

    When I check "lock cursor in screen center when game begins" it doesnt immediately take my cursor texture, I have to unlock it and lock it again.

    At that moment I see 2 cursors, AC cursor and Unity UI one at the same time,
    so I tried to check hide cursor when locked in screen center,
    but then it stops feeding the raw image graphics
    ( cursor stops changing when over hotspot )

  • edited July 2020

    When I check "lock cursor in screen center when game begins" it doesnt immediately take my cursor texture, I have to unlock it and lock it again.

    How are you making use of the script so far as its Inspector fields go? Let's see some screenshots of the UI, and your Settings / Cursor Managers, and I'll attempt a recreation.

    At that moment I see 2 cursors, AC cursor and Unity UI one at the same time,

    so I tried to check hide cursor when locked in screen center,
    but then it stops feeding the raw image graphics

    The Unity UI cursor's visibility will use the same rules for visibility, so if you opt to hide the cursor then the UI too will not be shown.

    Did you keep the Cursor rendering option set as Hardware?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.