docs.unity3d.com
    Show / Hide Table of Contents

    Triangle Wave

    Menu Path : Operator > Math > Wave > Triangle Wave

    The Triangle Wave Operator allows you to generate a value which linearly oscillates between a minimum and a maximum value based on a provided input and a set frequency.

    If Frequency is set to 1, the blue dot gos in a straight line from Min to Max and back to Min in the span on Input going from 0 to 1.

    You can use this Operator to directly move between any two values, for example moving particles up and down. If you set Min to 0 and Max to 1, you can use this alongside the Lerp Operator to interpolate between any two values, like positions or colors.

    Operator properties

    Input Type Description
    Input Configurable The value this Operator evaluates to generate the output value.
    Frequency Configurable The rate at which the Input value moves between Min and Max. Larger values make the wave repeat itself more.
    Min Configurable The minimum value that Out can be.
    Max Configurable The maximum value that Out can be.
    Output Type Description
    Out Matches Input The value this Operator generates between Min and Max based the Input and Frequency.

    Operator configuration

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

    Property Description
    Input The value type for the Input port. For the list of types this property supports, see Available types.
    Frequency The value type for the Frequency port. For the list of types this property supports, see Available types.
    Min The value type for the Min port. For the list of types this property supports, see Available types.
    Max The value type for the Max Port. For the list of types this property supports, see Available types.

    Available types

    You can use the following types for your Input, Min, and Max 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