docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method NextFloat

    NextFloat()

    Returns a uniformly random float value in the interval [0, 1).

    Declaration
    public float NextFloat()
    Returns
    Type Description
    float

    A uniformly random float value in the range [0, 1).

    NextFloat(float)

    Returns a uniformly random float value in the interval [0, max).

    Declaration
    public float NextFloat(float max)
    Parameters
    Type Name Description
    float max

    The maximum value to generate, exclusive.

    Returns
    Type Description
    float

    A uniformly random float value in the range [0, max).

    NextFloat(float, float)

    Returns a uniformly random float value in the interval [min, max).

    Declaration
    public float NextFloat(float min, float max)
    Parameters
    Type Name Description
    float min

    The minimum value to generate, inclusive.

    float max

    The maximum value to generate, exclusive.

    Returns
    Type Description
    float

    A uniformly random float value in the range [min, max).

    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)