Lecture hiding the cursor

Hi there everyone, I am doing the Unity Visual Scripting Course by Taryn McMillan and I had an “issue” with the cursor being hidden only once (since we are using the On Start node, I assume it’s an expected behavior). I have tried to change the On Start node for the On Update node and it works like a charm whenever I press right mouse to enter or Escape to exit the Lock State. Is it OK to use the On Update in this case? Could someone please elaborate? Thank you

Hello,

It should be ok in this case.

I’m not sure I understand the problem. When we set the cursor to be hidden in start, that’s the state of the cursor. When you press escape, Unity removes the focus from the game, but in the game the cursor state is still the same. When you click in the game screen again to restore focus to the game, the cursor disappears again, because that’s the state of the cursor in the game. This ‘escape to get your cursor back’ behaviour is only in the unity player. In a built game, this doesn’t work. It’s to allow the developer to get the cursor back during play mode. The only time it is necessary to do anything with the cursor state again in the game is when you want to make it visible to use on the UI - like when the player opens the pause menu and they need to see the cursor to be able to click buttons - and hide it again when that menu closes.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms