Hi there,
I've got this whole system where right clicking has the character draw a gun and all interactions change to a shoot interaction.
The problem is that right click also puts the gun away but if you right click over a hotspot he triggers the interaction which shoots and the gun also gets put away.
So basically I just want to disable right click doing anything except for calling the active input action list that draws/puts away the gun.
Is this possible?
Cheers.
Comments
I'm assuming the right-clicks are your "Examine" interactions? What you want to do is basically have an Action that can disable / re-enable all Examine interactions within a scene:
AC.Hotspot[] hotspots = FindObjectsOfType (typeof (AC.Hotspot)) as AC.Hotspot[];
foreach (AC.Hotspot hotspot in hotspots)
{
if (hotspot.lookButton)
hotspot.lookButton.isDisabled = true; // or 'false' to re-enable it
}
return 0f;
That'll go in your Run() function. If you want to be able to set the true/false state in the Action's UI, create a public bool and make a EditorGUILayout.Toggle field in the ShowGUI function.
How are you checking for a right click in your script? If you're checking for Input.GetMouseButtonDown (1), try instead checking for an input button instead, that's created in Unity's Input manager and mapped to "mouse 1", which is the equivalant of RMB.
You can import the 2D Demo into your project without affecting your game - the only thing that affects your game is the set of Managers that are loaded.
After importing the 2D Demo, choose Adventure Creator -> Getting started -> Load 2D Demo managers from the top toolbar and try out the demo scene, Park. Assuming your right-click is the same as mine and has no effect in this demo, compare the settings between the 2DDemo_SettingsManager and your own.
Once you've finished testing, you can re-assign your own game's Managers by finding the ManagerPackage asset file that was created by the New Game Wizard and clicking Assign managers in the Settings Manager.