docs.unity3d.com
    Show / Hide Table of Contents

    Smoothstep

    Menu Path : Operator > Math > Arithmetic > Smoothstep

    The Smoothstep Operator calculates the linear interpolation of a value between two border values with smoothing at the limits.

    This Operator returns a value between X and Y. Where this value is between X and Y depends on the value of S:

    • If S is greater than 1, the result is Y.
    • If S is less than 0 the result is X.

    • If S is between 0 and 1 then the result is a smooth transition between X and Y. The result = (Y - X) * ( 3S2 - 2S3 ) + X

    This Operator accepts input values of various types. For the list of types this Operator can use, see Available Types. The X and Y input are always of the same type. S changes to be the same type as X and Y.

    Operator properties

    Input Type Description
    X Configurable The value to interpolate from.
    Y Configurable The value to interpolate to.
    S Configurable A value for the interpolation. An input of either float type or the same type as X.
    Output Type Description
    Out Output Port The linear interpolation of S between X and Y with smoothing at the limits.
    The Type changes to match the type of X and Y.

    Operator configuration

    To view the Smoothstep Operator’s configuration, click the cog icon in the Operator’s header. X and Y must be the same type among Available Types. If S is a vector type, Unity calculates the interpolation value by value.

    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
    Terms of use
    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