Forum rules - please read before posting.

Right click on a hotspot to "LookAt"

Hi :)

In the game I'm working on the left mouse button opens a contextual menu with three different options (Talk, Use, LookAt) when you're over a Hotspot, and the right mouse button does nothing.

Is there a way to make the right mouse button to execute an specific use interaction (LookAt)?

Thans for your timeeeeee :)

Comments

  • edited October 2023

    You'll need a custom script that listens out for the input, and runs the interaction by referring to the LookAt icon's ID:

    using UnityEngine;
    using AC;
    
    public class RightClickLook : MonoBehaviour
    {
    
        public int lookIconID = 1;
    
        void Update ()
        {
            if (Input.GetMouseButtonDown (1) && KickStarter.stateHandler.IsInGameplay ())
            {
                Hotspot hotspot = KickStarter.playerInteraction.GetActiveHotspot ();
                if (hotspot)
                {
                    hotspot.RunUseInteraction (lookIconID);
                }
            }
        }
    
    }
    
  • Wow, Chris! I've a lot of assets from the AssetStore but I tell you that there's not support like yours, man. Thanks a lot!!

  • No problem, reviews are always welcome.

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.