0
Answered

Adventure Camera - Hide Mouse Cursor and/or avoid using mouse to make interactions

Mirabel 11 months ago in Game Creator updated by Marti (Lead Developer) 10 months ago 1

Hi everyone, 

First of all congratulations for this wonderful set of tools! 

I am admiring your work for a long time already and I am willing purchase and integrate Game Creator in my project along with the other extensions (Dialogue, Inventory, Quests, etc).

My question is related to the Adventure Camera motor: 

I've seen that in most of the videos/tutorials the mouse cursor is always visible on the screen and it moves along with the camera which orbits around the player.


I am wondering, is there any way of hiding the mouse cursor when using the Adventure Camera and maybe having it appear only during dialogues, interactions with the inventory and mostly during situations where you have to make a certain selection from a UI?

For example I want to trigger a dialogue scene by just pressing [E] next to a NPC and not by clicking on the character in the world (same way for interacting with a shopkeeper and so on). 

If my questions is stupid I am sorry in advance, I just want to know if basically you can avoid using the mouse cursor to interact with stuff in the world and replace everything by trigger areas with keyboard/controller button inputs so you don't see the mouse at all unless you really need it during a UI page (inventory, dialogue).

Have a good day!

Unity version:
Game Creator version:

Answer

+1
Answer
Answered

Hi Mirabel;

Thank you very much for your kind words. Your question is not at all stupid, feel free to ask anything :-)

Regarding your question, we didn't want to bind the cursor's mode to any camera motor. Instead, there's an Action called "Cursor" that allows you to modify the cursor's state.

If you want to start your game with the adventure camera motor and the cursor locked at the center of the screen (and probably hidden), you can use a "On Start" Trigger that calls the Action Cursor. This Action should have the state property set as "Locked" and visibility to "Hidden".

Now what happens when you start a Dialogue? Same thing. Right before you call the Dialogue Action, use the Cursor Action to "Unlock" the cursor state and set the visibility to "Visible". Because the Dialogue Action is put on hold while the Dialogue plays, you can duplicate the Cursor Action and place it right below the Dialogue action, changing its values to Locked and Hidden. This will ensure that as soon as the Dialogue is completed, the cursor will be locked back at the center of the screen.

Hope this helps!

GOOD, I'M SATISFIED

Wonderful! 

Thank you for the explanation, that is exactly what I hoped to hear!

Again, you did a great work putting all this together and maintaining a wonderful logic which I think will suit every need.

In this case, I will definitely purchase your tools from the store soon enough, can't wait!


Thank you again and have a great day; good luck with everything man!

Satisfaction mark by Mirabel 10 months ago
+1
Answer
Answered

Hi Mirabel;

Thank you very much for your kind words. Your question is not at all stupid, feel free to ask anything :-)

Regarding your question, we didn't want to bind the cursor's mode to any camera motor. Instead, there's an Action called "Cursor" that allows you to modify the cursor's state.

If you want to start your game with the adventure camera motor and the cursor locked at the center of the screen (and probably hidden), you can use a "On Start" Trigger that calls the Action Cursor. This Action should have the state property set as "Locked" and visibility to "Hidden".

Now what happens when you start a Dialogue? Same thing. Right before you call the Dialogue Action, use the Cursor Action to "Unlock" the cursor state and set the visibility to "Visible". Because the Dialogue Action is put on hold while the Dialogue plays, you can duplicate the Cursor Action and place it right below the Dialogue action, changing its values to Locked and Hidden. This will ensure that as soon as the Dialogue is completed, the cursor will be locked back at the center of the screen.

Hope this helps!