Forum rules - please read before posting.

Using Xbox one LT and RB trigger

edited April 2020 in Technical Q&A

Hi every one,

I'am trying to made a diary/note book for my adventure game.
The idea is to use my LB and RB to navigate between the tabs (Map and Notes).
For the Map Tab there only one page, but for the notes tab, there are for now 3pages.
The idea is to use my LT and RT to navigate between the journal pages of the notes tab.

In my input manager i assigned the LT (9th Axis) and RT (10th Axis) i used this page for the assignation : https://answers.unity.com/questions/1350081/xbox-one-controller-mapping-solved.html

Here my input manager : https://ibb.co/rpp9W1r
and my inspector : https://ibb.co/ZNqzV6J

I think the issue is from the fact that for unity LT and RT are joystick and not button.

Hope i was clear enough.

Thanks

Comments

  • Yes - these are axes, that respond to Input.GetAxis, as opposed to buttons that respond to Input.GetButtonDown.

    What you can do is assign an override for AC's internal InputGetButtonDown, and then read the axis value directly. Though, you'll also need to record whether or not you've pressed it, so that you have to then release it before it can register as a button again.

    Something like this:

    using UnityEngine;
    using AC;
    
    public class InputOverride : MonoBehaviour
    {
    
        private float threshold = 0.3f;
        private bool released = true;
    
        void Start ()
        {
            KickStarter.playerInput.InputGetButtonDownDelegate = CustomGetButtonDown;
        }
    
        private bool CustomGetButtonDown (string buttonName)
        {
            if (buttonName == "Navigation")
            {
                if (Input.GetAxis (buttonName) > threshold && released)
                {
                    released = false;
                    return true;
                }
                released = true;
                return false;
            }
    
            try
            {
                return Input.GetButtonDown (buttonName);
            }
            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.