Thank you for an amazing tool! I'm a beginner Unity user working on a 2D adventure game, practically no experience in programming and I'm not entirely sure if the things I want require some programming. Been messing around with AC for tens of hours and slowly getting the hang of it. Right now I've been a bit stuck on mapping the controls to my liking. The question:
How can I change the interactions that happen from left and right mouse clicks? I'm planning to do something like this:
Left mouse click: controls the player around, goes towards hotspots.
Left mouse hold for 0.5 seconds: opens up the interaction menu/buttons on the pressed hotspot; if not pressed on a hotspot then the holded mouse button does nothing other than follow the path towards the clicked point. The game should wait for the correct action before either moving character or opening the interaction menu, so the movement should trigger only when the mouse is pressed anything between 0 and 0.49999 seconds.
Right mouse click: opens up the interaction menu/buttons on the pressed hotspot but nothing else, so clicking with right button is merely an alternative to the 0.5 mouse click hold.
If these actions are something that require programming, then I'll have to ask for additional guidance. Hoping for there to be options for very creative button mapping within AC. What I'm working on now is merely a beginning, because I have a lot things I'd like to do with the controls. Right now the things above are my top priority.
I'm initially making the game for PC and Mac. All help appreciated! Hope my problem description makes sense. Thank you again.
Comments
However... might I suggest that you not do what you're trying to do. I have seen a couple games that do that hold-the mouse-button-for-the-menu thing, and it's generally considered by most people to be annoying. Also having a non-standard (and redundant) right mouse action will further annoy people (right mouse usually either examines or cycles the cursor) Just a heads up on that.
Inputs can be remapped with some very simple scripting (see Section 12.9 for more on that), but writing a custom interaction system is more complicated.
As it sounds like you intend to use an AC Interaction menu, re-writing your own complete interaction system may not be necessary (though still possible). Instead, set the following options in your Interface settings:
Interaction method: Choose Hotspot Then Interaction
Select interactions by: Clicking Menu
See Interactions with: Via Script Only
This last option will prevent the interaction menu from opening normally, and instead will only do so when the following script command is called:
AC.KickStarter.playerMenus.EnableInteractionMenus (myHotspot);
(To open them for a Hotspot called myHotspot)
AC.KickStarter.playerMenus.EnableInteractionMenus (myInvItem);
(To open them for an inventory item called myInvItem)
The currently-active Hotspot underneath the cursor can be found with:
AC.KickStarter.playerInteraction.GetActiveHotspot ();
Therefore, the following code should open an Interaction Menu for the active Hotspot:
Hotsopt activeHotspot = AC.KickStarter.playerInteraction.GetActiveHotspot ();
AC.KickStarter.playerMenus.EnableInteractionMenus (activeHotspot);