Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Gamepad Right Stick XZ#

Input / Gamepad Right Stick XZ

  • Can Read

  • Cannot Write

Description#

Returns the value of the Right Stick on the X and Z axes

Code#

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

namespace VisualScript.Runtime
{
    [Get]

    [Title("Gamepad Right Stick XZ")]
    [Category("Input/Gamepad Right Stick XZ")]

    [Description("Returns the value of the Right Stick on the X and Z axes")]
    [Image(typeof(IconJoystick), ColorTheme.Type.Blue, typeof(BadgeArrowRight))]

    [Keywords("Move", "Joystick", "Plane", "Ground")]

    [Serializable]
    public class TypeVector3InputGamepadRightStick : TypeVector3
    {
        [NonSerialized] private UnityEngine.InputSystem.InputAction m_InputAction;

        ~TypeVector3InputGamepadRightStick()
        {
            this.m_InputAction?.Disable();
            this.m_InputAction?.Dispose();
        }

        private UnityEngine.InputSystem.InputAction InputAction
        {
            get
            {
                if (this.m_InputAction == null)
                {
                    this.m_InputAction = new UnityEngine.InputSystem.InputAction(
                        name: "Right Stick",
                        type: InputActionType.Value,
                        binding: "<Gamepad>/rightStick"
                    );

                    this.m_InputAction.Enable();
                }

                return this.m_InputAction;
            }
        }

        public override Vector3 Get(Args args)
        {
            Vector2 value = this.InputAction?.ReadValue<Vector2>() ?? default;
            return new Vector3(value.x, 0f, value.y);
        }

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

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.