Forum rules - please read before posting.

Issue with the 2D Demo

So sorry to ask a so easy question, I arrived to AC only 2 days ago... I'm following the tutorial, but when I arrive to the chapter about the hotspot... I cannot find the way to activate the menu interaction. I set as the tutorial said "Choose interaction the hot spot"... but the right click doesn't work (I have a Mac with touchpad... so CTRL+click). On the contrary if I set "Choose hotspot than interaction" it works! Like the demo that has this setting.
Could someone give me a suggestion? I'm getting crazy!
Thanks a lot

Comments

  • Sorry, with double fingers on the touchpad it works... but not with CTRL and click

  • Welcome to the community, @Fedek72.

    I'm on a Mac w/ touchpad as well. AC detects the right-mouse button to cycle through interactions (as well as any input named "CycleCursors"), so what counts as a "simulated" right-click on touchpads is handled by Unity. AC itself isn't detecting for double-fingers directly.

    However, it is possible to override AC's input detection through script. This is a pretty advanced topic (see the Manual's "Remapping inputs" chapter if you are interested), but the following script should force detection for control+clicking manually:

    using UnityEngine;
    using AC;
    
    public class MacRightClick : MonoBehaviour
    {
    
        private bool controlRightClick;
    
    
        void Start ()
        {
            KickStarter.playerInput.InputGetButtonDownDelegate = CustomGetButtonDown;
        }
    
    
        private void OnGUI ()
        {
            if (Event.current != null)
            {
                Event current = Event.current;
                if (current.isMouse && current.control)
                {
                    controlRightClick = true;
                }
            }
        }
    
    
        private void LateUpdate ()
        {
            controlRightClick = false;
        }
    
    
        private bool CustomGetButtonDown (string buttonName)
        {
            if (buttonName == "CycleCursors" && controlRightClick)
            {
                controlRightClick = false;
                return true;
            }
    
            try
            {
                return Input.GetButtonDown (buttonName);
            }
            catch {}
    
            return false;
        }
    
    }
    

    Paste that into a new C# script named MacRightClick.cs, and attach the new "Mac Right Click" component to a GameObject in your scene. You should find that you can then cycle through the various cursors using both methods.

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.