docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetAnalogInput

    GetAnalogInput(float, float)

    Combines two floating point values into a float2 value.

    Declaration
    public static float3 GetAnalogInput(float x, float y)
    Parameters
    Type Name Description
    float x

    The horizontal value; expected to be in the range -1 to 1.

    float y

    The vertical value; expected to be in the range -1 to 1.

    Returns
    Type Description
    float3

    The corresponding float2 value.

    Remarks

    Normalizes the resulting float2 value if the magnitude is greater than 1.0.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)