Forum rules - please read before posting.

Question about cursor visibility.

edited February 4 in Technical Q&A

I’ve encountered an issue that I can’t seem to fix on my own. For context, this is what I’m trying to do: I have several scenes where I’d like the cursor to be completely locked and not visible. I’ve added Cursor: Disabled at the OnStart of the scene, and it works fine, but when I change scenes the cursor seems to enable itself by default. I think I’ve checked all of the ActionLists, and I don’t think I’ve enabled it by accident. I’ve added a video of the issue.

For this portion of the game, I would like to completely disable the mouse, as it’s interfering with some UI elements and also appears in the center of the screen. <- at 0:45 you can see the middle button option of the prompt is selected by the mouse (I think)

This is my setup in the Interface Manager. I’m using Unity UI as the cursor rendering method.

https://drive.google.com/file/d/1r4openyGrZmUDmIrGHNlQr81XunSX8Oc/view?usp=sharing

Video:

https://drive.google.com/file/d/1_0WyWc0f71PVYxcTysT2NFyK1EITgY_6/view?usp=sharing

Any sort of help would be much appreciated. I’ve tried fixing it myself, but I feel like I’m running in circles.

Thank you in advance.

Comments

  • The cursor's visibility is handled by the scene logic, so you'll need to re-disable it upon switching scene.

    The easiest way to do this is to rely on a Global Boolean variable (e.g. "Lock cursor") that you can refer to when starting a scene.

    To run an ActionList logic that checks the Variable, and locks the cursor, when the scene begins - without creating OnStart cutscenes for each scene - use the Events Editor in AC's top toolbar. From there, create a Scene: Change: After event, called whenever a scene-change has completed.

  • Hi Chris, I figured I'd need to do something like that but I wanted to be sure. Thank you! Question, do I need to disable it in both Player Contrains and in Engine Cursor?

  • https://drive.google.com/file/d/1qaQ3BrdVSpfet-CtTqYVEN23wnX-CISc/view?usp=sharing <- Here’s a video of the setup. For some reason, it behaves exactly the same. Could another event or ActionList be interfering with this? I set it up as you suggested using OnAfterChangeScene with a variable check. When Cursor Controller (Disable) is true, it disables both the engine and player cursor; when false, it enables them.

  • Avoid using the Engine: Manage systems here - disabling the Cursor there only refers to AC's control over the cursor.

    Also, the Player: Constrain Action's Cursor lock field will lock the cursor if it is set to True - this should be set to False when you want cursor control.

  • Wow, I'm so dumb. I haven't used the method a lot so I was doing the opposite. Thank you. Fixed it.

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.