Forum rules - please read before posting.

Right Click does not register. Any assistance appreciated!

Hello,

I had been wondering for a while, why my Context Sensitive did not register right clicks at all in my Inventory Box element, but seemed to register just fine on Hotspot. Only my left click will work in my Inventory.

I want to use the Left click for normal drag/drop but right click to Examine or even Use the item etc.

I started using Debug.Log in several places in Adventure Creator script around MouseState.Rightclick to see if my right clicks were even registering. I found out that my Right Click can register everywhere except for my Inventory on an item.

Settings Manager:
Left and Right Mouse clicks have default functionality - tried both clicked and unclicked. Right click still doesn't work in inventory.
Interaction Method: Context Sensitive
Inventory Menu is set to Default not a custom script.
I have InteractionB set up to mouse 1 as well in my Input - Project Settings

I have a quick video showing where I put my Debug.Logs/proving that my right click is not registering in the Inventory only but is registering everywhere else. Any assistance on figuring out why my Right click is not registering in Inventory would be greatly appreciated!

I apologize the audio is a bit low.

Comments

  • The "InteractionA" and "InteractionB" inputs are only necessary if you uncheck the Left and Right Mouse clicks have default functionality? option. I would recommend removing them, or unsetting them from the mouse buttons, if that option is checked.

    Your video goes a bit quickly through the various Manager settings, but what you've shown should all be OK. Please let me know your AC and Unity version numbers, though.

    This may be related to the fact that your menu is rendered with Unity UI, which requires a bit of trickery to get right-clicks to respond. AC achieves this by adding its "UI Slot Click" component to Inventory slot buttons at runtime - are you finding these on your UI once the game is running? If you're interested in further debugging, the right-click command is sent from that script's OnPointerClick function.

    This may be an issue specific to your InventoryBox UI prefab/menu, since I can't recreate such an issue with the default interface. As a test, load up the 3D Demo's Managers, add the Sword item to the player by default, and give it a sample "Examine" interaction. You should find that, when running a fresh AC scene, you can right-click to examine the Sword both when the Inventory uses AC and Unity UI to render (both are supported by the demo's menus). Examining the differences between your Menu/Canvas prefab and the Demo's, as well as the Settings Managers, may reveal what's causing the issue.

  • edited July 2019

    Thank you for responding so quickly and helping out.

    ***Removed Interaction A + B ****

    I removed the InteractionA and B under Input>Project Settings. I also made sure the Left/Right Mouse Clicks have default functionality is clicked.

    Manager Screenshots

    I will make sure to include all my managers, here they are.

    Scene Manager
    https://i.imgur.com/sn5Z4Lf.png

    Menu Manager
    https://i.imgur.com/yvIFH5S.png

    Inventory Manager
    https://i.imgur.com/bHnXEn7.png

    Settings Manager
    https://imgur.com/vSJsBX0

    I didn't include the Variables, Actions, Speech, or Cursor Manager. Please let me know if you would like to see these and I can include them as well

    ****UI Slot Click Issue***

    I do see on every single button a UI Slot Click script already added to each and every single button.

    I did a bit of debugging and I think this is where the issue is. Line 42 has an && Component required for InteractionB, but if we delete InteractionB from our InputSettings, this will not work.

    Here is the image of what I'm talking about
    https://i.imgur.com/KkSiros.png

    Now if I change it from InteractionB To Fire2 which is Unity's default for right clicking then I have a bit of success, it goes into the first if statement. But now its hung up and not registering on this if statement if (KickStarter.playerMenus.IsEventSystemSelectingObject (gameObject)) as seen by this Debug.Log only registering line 44 and not reaching line 47 (my second debug.log)

    Proof of UI Right Click stopping at line 44
    https://i.imgur.com/SSczVjq.png

    Test the Demo Scene

    I only had to switch the Inventory and Menu Managers and the sword definitely works using the Demo Manager.

    Do you suggest changing my UI to Adventure Creator UI? Would this cause any potential issues?

    I will still be inspecting the canvases or trying to figure out why the Demo manager is working but mine isn't.

    Also what do you think about the InteractionB/that script being the issue here. How do I trigger IsEventSystemSelectingObject?

    Any assistance would be greatly appreciated! Thank you for the suggestions at least I learned about the UISlotClick registering right clicks that was super helpful!

  • The check for "InteractionB" in the Update loop is not for native mouse right-clicking. With Left and Right Mouse clicks have default functionality? enabled, the script's OnPointerClick function is where the right-click should be detected.

    Do you suggest changing my UI to Adventure Creator UI? Would this cause any potential issues?

    I'm not suggesting this as a permanent change - just a temporary one to learn the effects of it, to help us find the source of the problem.

    I will still be inspecting the canvases or trying to figure out why the Demo manager is working but mine isn't.

    Your Inventoy and Menu Managers both look fine - I suspect that the issue will lie with your own Inventory prefab, so I would recommend doing this as well.

  • Just wanted to say thank you for helping me out.

    In the end I couldn't figure it out, but good news, you turned me on to the Adventure Creator menus, once I played around with them a bit, I was able to get it to overlay onto my menu set up. So it functions exactly how I wanted to now. Thank you for this!

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.