Hi there,
I'm looking to assign the "Examine" action to the Left Click in the AC Game Editor. As of now, my configuration sets "Left Click" to "Use" and "Right Click" to "Examine item". I explored the "Drag and drop Inventory interface" in the editor, but couldn't find an option to set the Left Click to "Examine Item".
Is a custom script the solution?
I also found a 2018 post (here). While the OP's configuration differs slightly from mine—mine doesn't utilize a 'Monkey Island-like' interaction system—the link they provided (http://pasteall.org/896645/csharp) is unfortunately defunct.
Any guidance would be deeply appreciated. Thanks in advance!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
There's no link to the post you mention - can you post the link again?
You can disable the default click behaviour by unchecking Mouse clicks have default functionality? in the Settings Manager.
You can then swap their behaviours around either by creating inputs named InteractionA and InteractionB, and mapping them to "mouse 1" and "mouse 0" respectively.
To preserve left-clicking for Menus, you'll need to rely on Unity UI.
The alternative approach would be to use scripting to swap the left/right clicks only at certain times - e.g. when dealing with Hotspots/Inventory. I can advise further, but I'll need more details about when exactly you'd be looking to swap inputs.
It's possible to examine an item with a left-click when drag-and-drop mode is enabled - but it depends on your interaction settings. If your interaction method allows for it, the Can drop an Item onto itself to Examine it? option will appear to give you this functionality.
Thank you so much for your guidance, Chris!
I realize I didn't provide some key clarifications, and I apologize for the oversight. When I mentioned "Examine," I was referring exclusively to inventory items. As of now, players can right-click an inventory item to view a larger image, open a book, etc. This mimics the behavior in the Chamber Demo (my game is 2D, by the way). I adapted your code, created a prefab, and integrated it into every scene.
Interface & Inventory Settings
https://imgur.com/ojroorA
What I'm aiming for now is to allow players to "drag and drop the inventory item (using the left click)" to interact with hotspots and such. Moreover, a "single left click on the inventory item" should open the Examine menu or other menus like diary, objectives, etc., for more detailed information.
Your advice regarding the "Drag and drop Inventory interface" and the "Can drop an item onto itself to Examine it?" settings worked precisely as I had hoped! The only hiccup is the inability to toggle (left-click to open the Examine Menu and another left-click to close it). How can I achieve this toggle functionality with a single left-click?
Referring to your mention of an alternative approach:
Could you clarify if I need to navigate to [Project Setting] > [Input Manager], then expand the "Axes" and create InteractionA and InteractionB?
Regarding the missing link, my apologies again. Here's the link, in case you're curious:
https://adventurecreator.org/forum/discussion/7345/examine-an-inventory-item-with-left-click
Specifically, the left-click to close?
If you have a separate Examine menu, you could make the Menu itself span the full-screen, with (invisible) Buttons on each edge that close the Menu. That way, wherever you click, it'd react.
Yes, that's what I was getting at - but it may not be necessary given the alternative.
Thanks a lot for your help!