docs.unity3d.com
    Show / Hide Table of Contents

    Discretize

    Menu Path : Operator > Math > Clamp > Discretize

    The Discretize Operator outputs the multiple of the B value that is closest to A. For example, an input of A = 7.2 and B = 3, outputs 6.

    This Operator accepts input values of various types. For the list of types this Operator can use, see Available Types. The B input can be either the same as A or a float.

    Operator properties

    Input Type Description
    A Configurable The value to discretize. The Operator rounds this value to the nearest multiple of B.
    B Configurable The value this Operator discretizes A to. This input type can be either a float or the same type as A.
    Output Type Description
    Out Dependent The rounded value of the input.
    The Type changes to match the type of A.

    Operator configuration

    To view the Node's configuration, click the cog icon in the Node's header.

    Available types

    You can use the following types for your input ports:

    • Float
    • Vector
    • Vector2
    • Vector3
    • Vector4
    • Position
    • Direction
    In This Article
    • Operator properties
    • Operator configuration
      • Available types
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023