Forum rules - please read before posting.

Cycle through interaction with Scroll/mouse Wheel

Hello, I showcased a demo of my adventure game recently and noticed that the player does a lot of clicking to get through different cursor interactions. so based on feedback from players and my small team we want to add the ability to scroll the mouse wheel to go through different interactions (look at, pick up etc.)

However, I am unsure how to go about this there doesn't seem to be an option for this in settings (or at least from what I can see) there is an available input called CycleCursors I don't know if that can help.

note: I am using AC 1.68.4

if anyone is able to help that be much appreciated. I saw this post from few years ago https://adventurecreator.org/forum/discussion/4420/cycle-with-scroll-wheel but it hasnt been able to help me

Comments

  • The CycleCursors input is indeed used to scroll through the various cursor modes. To use it, you need to create a new Input with this name in Unity's Input Manager.

    To react to mouse scrollwheel, you need to map this input to the 3rd Mouse Axis.

    Unity's default Input Manager already includes such an input named "Mouse ScrollWheel". Renaming this to CycleCursors should do the trick.

  • Hi Chris I changed the mousescroll wheel to CycleCursors and type is mouse movement and axis is set to 3rd axis however it still doesn't work do I need a positive button for it to work. I also tried increasing sensitivity but it didnt work :/

  • Apologies, yes - it is a button.

    What are your full Interaction settings set to? Let's see a screenshot of them from your Settings Manager.

  • Hi Chirs

    Here is an image of the input manager https://imgur.com/tHhYy6Q

  • It's the Settings Manager I'm after.

    Assuming your Interaction method is set to Choose Interaction Then Hotspot, then I'll have to look into including this as a new feature in the next release by way of a separate "CycleCursorsBack" button.

  • Sorry got confused here is a image of interface setting: https://imgur.com/a/ftzviX1

  • No problem. Yes, this is a feature I'll have to incorporate.

  • Here, try this with v1.71:

    using UnityEngine;
    using AC;
    
    public class CycleCursorsScrollwheel : MonoBehaviour
    {
    
        public string axisName = "Mouse ScrollWheel";
        public float axisThreshold = 0.4f;
        private bool isLocked;
    
    
        private void Start ()
        {
            KickStarter.playerInput.InputGetButtonDownDelegate += GetButtonDown;
        }
    
    
        private bool GetButtonDown (string axis)
        {
            try
            {
                float scrollwheel = Input.GetAxisRaw (axisName);
                if (axis == "CycleCursors")
                {
                    if (!isLocked && scrollwheel > axisThreshold)
                    {
                        isLocked = true;
                        return true;
                    }
                }
                else if (axis == "CycleCursorsBack")
                {
                    if (!isLocked && scrollwheel < -axisThreshold)
                    {
                        isLocked = true;
                        return true;
                    }
                }
    
                if (scrollwheel < (axisThreshold / 2f) && scrollwheel > -(axisThreshold / 2f))
                {
                    isLocked = false;
                }
    
                return Input.GetButtonDown (axis);
            }
            catch {}
    
            return false;
        }
    
    }
    
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.