Forum rules - please read before posting.

D-Pad speed in Menus

edited August 2021 in Technical Q&A

Hello!

Is there a way to set the D-Pad speed ( Vertical ) to move quickly up and down in the menu? Right now I have to hit the up/down to move one item at a time and there seems to be a delay if I click too fast.

Thanks!

Comments

  • Is this for an AC menu, or Unity UI?

    When directly-navigating an AC menu, selecting an element will lock scrolling until the input magnitude goes below a threshold of 0.05.

    I can look into making this configurable, but you can alter this value manually by editing the following line in PlayerInput.cs:

    if (rawInput.y < 0.05f && rawInput.y > -0.05f && rawInput.x < 0.05f && rawInput.x > -0.05f) 
    
  • edited August 2021

    Yes, it's AC menu. I would like it if I can just hold the button down and it would move until I let go. Trying to avoid having to click up or down each line.

    Adding this feature would be nice, as a configurable item.

    A suggestion would be if you can modify the Digital Axis Gravity and Digital Axis Sensitivity. I was able to set them both to 100 and it seems to be good.

  • edited August 2021

    Custom scroll behaviour of that type can be implemented by subclassing the PlayerInput script and having it replace the Player Input component on your GameEngine object:

    using UnityEngine;
    using AC;
    
    public class CustomPlayerInput : PlayerInput
    {
    
        private const float delay = 0.2f;
        private float scrollReleaseTime;
        private bool lastFrameLocked;
    
        private void Update ()
        {
            if (scrollingLocked && !lastFrameLocked)
            {
                scrollReleaseTime = delay;
            }
            lastFrameLocked = scrollingLocked;
    
            if (scrollReleaseTime > 0f)
            {
                scrollReleaseTime -= Time.unscaledDeltaTime;
    
                if (scrollReleaseTime <= 0f)
                {
                    scrollingLocked = false;
                    lastFrameLocked = 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.