Forum rules - please read before posting.

Enabling cursor movement on documents

edited January 2020 in Technical Q&A

Hello I'm using the "lock cursor in center while game begins" and in the cursor settings I have ticked "lock system cursor while locking AC cursor" and "confine cursor to game window".

I have a document menu that uses a scrollbar, so I need the cursor to move freely, I've tried running an AC action with both player > constrain: cursor lock = disabled and Engine>manage systems:cursor = enabled. But the cursor is still frozen in the middle of the screen.

How should I create the desired behavior (of unlocking the mouse on documents menu the game as when using the pause button) ?
I'm using latest AC (1.6.7/1.7.0) and Unity 2019.3 windows.

Comments

  • The Player: Constrain Action is all you should need - placed inside the Menu's "ActionList when turn on" asset file.

    The cursor's lock state can also be toggled by invoking an input named "ToggleCursor" - is there any change when you press this (just for testing)?

  • edited January 2020

    No, I've tried using toggle cursor and it doesn't work either (not in gameplay nor in pause).
    When opening the document menu the cursor does appear in the middle of the screen, but it's locked,

    Here are my settings:



    The mouse unlocks on the pause menu as intended.

    EDIT: The ToggleCursor input works if I press it before I open the document.
    EDIT2: It seems that the ToggleCursor Input only works after I press pause.

  • edited January 2020

    ToggleCursor will only have an effect during gameplay. I see now that the Document menu pauses the game, so that sounds correct.

    What is your "Input method" set to in the Settings Manager? If you prevent the Document menu from pausing the game, can you then control the lock state?

  • edited January 2020

    Movement method is Direct and Input method is mouse and keyboard.
    I changed the mouse cursor settings display to always, and no, toggling it doesn't work (but I notice there's a jittery motion of the cursor that doesn't appear when it's locked).
    Honestly no idea what is locking the mouse, and why it doesn't affect the pause menu.
    EDIT: I've tried with another project and the function works as intended, there's something else "locking the mouse", but I don't have anything that would interject with the scripts.
    EDIT2: I was using a "provided Unity Event system prefab" on the menu settings (the same one I already had on scene), I deleted that setting and now it's working as inteded.
    No real idea about the underlying reason for it, but happy that now it works.
    Many thanks.

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.