Forum rules - please read before posting.

Mouse Cursor Pulled Back to Screens Center in Paused Options Menu

Hi Chris,

I'm having this strange issue. I say it's strange because it only occurs in most of my scenes, but not all. When the game is paused and I attempt to use the options menu the cursor acts wonky and pulls back to the center. If this happens on all of my scenes I would assume it was something in the script or menu, but its' the exact script and menu on all scenes so I'm puzzled as to why it does this only on certain scenes.

The pause game while enabled is ticked on so that's not it, and I can move the mouse to the sliders, but as soon as I do the PC mouse icon also appears and pulls my game mouse icon back the center of the screen. I've attached some gifs for reference.

This one is the wonky one:
https://imgur.com/bXNX8xj

And this is the functional one on a different scene ignore the fact that its distorted the gif maker did that:
https://imgur.com/vcxEWSg

I don't know which version of AC I'm using, but it's an old one from about 4 years ago, however I doubt that has anything to do with it since I've been using this same version for 4 years and never encountered this.

Thanks much!

Comments

  • Welcome to the community, @MayhemGamesUSA.

    I'd have to know the exact version, given that it's so old a version you're using. From that far back, you should be able to learn the number from the top of the Changelog file.

    What Unity version, also?

    You mention the scenes as having the "exact scripts" - does this mean you're relying on custom scripts to control anything?

    It looks like the system cursor is becoming locked somehow - it could be from AC, or from a custom script.

    If it's coming from AC, it'll be done in the UnityVersionHandler's CursorLock setter - around line 85. Try placing a Debug.Log statement in there, so you have something like:

    public static bool CursorLock
    {
        get
        {
            #if UNITY_5
            return (Cursor.lockState == CursorLockMode.Locked) ? true : false;
            #else
            return Screen.lockCursor;
            #endif
        }
        set
        {
            #if UNITY_5
            if (value)
            {
                Cursor.lockState = CursorLockMode.Locked;
            }
            else
            {
                Cursor.lockState = CursorLockMode.None;
            }
            #else
            Screen.lockCursor = value;
            #endif
            Debug.Log ("Lock state: " + value);
        }
    }
    

    Check the Console at the time the issue occurs - do you get a "Lock state: True" message showing? If so, select it and paste the full contents here so that we can see what's triggering it.

    Otherwise, it may be coming from a custom script - in which case, search your project for instances of "Screen.lockCursor" or "Cursor.lockState".

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.