Forum rules - please read before posting.

CycleInteractions with Input System integration

edited November 2022 in Technical Q&A

Having trouble setting CycleInteractions (mousewheel axis) with the otherwise integrated Input System. The option doesn't show up generated anywhere, in ControlsReader or Controls.cs. And if I enter it manually, as in the picture, it doesn't work either.

Comments

  • edited November 2022

    OK I got it. First I need to type it into Controls.cs by hand under UI actions, then find the new entry in ControlsReader's dropdown to activate it.

  • Updating Controls.cs by hand shouldn't be necessary - but the Controls asset will need saving after making changes.

  • I seem to have a somewhat related issue though: using your WD template, the active item on the wheel is set to be highlighted, but they fail to highlight. I know that CycleInteractions do work only because the UI text underneath updates to Use/Look/Talk as expected.


  • edited November 2022

    What are your AC/Unity versions, and do you get this behaviour with all of the template's Managers assigned (Settings Manager included)?

    You will need to have your Settings Manager's Select Interactions by field set to Cycling Menu And Clicking Hotspot, but that should cause the UI Buttons to auto-select as you cycle through them with the CycleInteractions inputs.

    Otherwise, you could use a custom script to auto-select the Button:

    using UnityEngine;
    using AC;
    
    public class AutoSelectInteractionButton : MonoBehaviour
    {
    
        public int associatedIconID;
        public UnityEngine.UI.Button button;
    
        void Update ()
        {
            if (associatedIconID == KickStarter.playerInteraction.GetActiveUseButtonIconID ())
            {
                button.Select ();
            }
        }
    
    }
    
  • Thanks, using 2021 LTS and latest AC, with all WD managers assigned.
    I did try to adapt your WD template to take advantage of Unity UI's button highlight options, but there's no highlight to be seen.
    It is already set on Cycling Menu:

    Will try this script.

  • edited November 2022

    The script causes a NullReference once a Button shows up.
    Please check, if you find the time, if Button highlight (color tint) works on your end in the context of AC menus.
    I suspect it's a Unity bug, I did find an old report.

  • I updated a typo in the above script - you'll need to attach it to each Button object and assign the Button in its Inspector.

    Please check, if you find the time, if Button highlight (color tint) works on your end in the context of AC menus.

    It does, yes.

  • edited November 2022

    Thanks, with the script on each Button (and assigned), color tint does appear, but all mixed-up: when I cycle to Look, all 3 icons get highlighted, when I cycle to Talk to, none of them are highlighted...
    Button navigation is set to Everything.

    Edit: seems to me that UCC + Input system integration are interfering with my button interactions. Apart from those and AC, it's an empty project.
    Also, Sprite Swap doesn't work either with Buttons, not just Color tint.

  • edited November 2022

    Just checked WD template menu cycling on a different URP (2022.1.20) project, Button highlight (color tint) doesn't work there either. (Button navigation set to Automatic, as default.)

  • when I cycle to Look, all 3 icons get highlighted, when I cycle to Talk to, none of them are highlighted..

    Apologies. The script's "associatedIconID" must also be public, and then set in the Inspector to match its associated icon. I have updated the script once more.

    Just checked WD template menu cycling on a different URP (2022.1.20) project, Button highlight (color tint) doesn't work there either.

    It seems to not tint for the first active icon shown when the Menu is turned on, but it does tint subsequent icons as they are selected via input.

  • Thank you, SOLVED.

    (On the URP project I made the noob error of using a mixture of both input systems, and AC was listening to the old input manager's CycleInteractions entry which I forgot to add in. It works without custom scripting in that project.)

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.