---
tags:
    - "Analog"
    - "Axis"
    - "Shoulder"
    - "R2"
    - "RT"
---

# Gamepad Right Trigger

[Input](index.md) / **Gamepad Right Trigger**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns how much the Right Trigger of the current Gamepad is pressed

## Code

```cs
using System;
using UnityEngine.InputSystem;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Gamepad Right Trigger")]
    [Category("Input/Gamepad Right Trigger")]

    [Description("Returns how much the Right Trigger of the current Gamepad is pressed")]
    [Image(typeof(IconGamepadSlider), ColorTheme.Type.Blue, typeof(BadgeArrowRight))]

    [Keywords("Analog", "Axis", "Shoulder", "R2", "RT")]

    [Serializable]
    public class TypeNumberInputGamepadRightTrigger : TypeNumber
    {
        public override double Get(Args args)
        {
            Gamepad gamepad = Gamepad.current;
            return gamepad != null ? gamepad.rightTrigger.ReadValue() : 0d;
        }

        public override string ToString()
        {
            return "Gamepad Right Trigger";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

```

