Search Unity

Trail Renderer widthCurve

Discussion in 'General Graphics' started by chromanox, Mar 24, 2019.

  1. chromanox

    chromanox

    Joined:
    Mar 7, 2019
    Posts:
    1
    Hello everyone,

    I want to add the ability to create holes in a TrailRenderer trail. However, it is not clear to me whether the x-axis of the widthCurver refers to length or time. Sadly, the documentation does not provide this detail. I would greatly appreciate an answer.
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    It is the width over the entire visible trail.

    So the start of the curve describes the width at one end of the trail, and the end of the curve describes the width at the other end of the trail.

    So the X axis describes "amount along length of trail".

    From the manual:

    https://docs.unity3d.com/Manual/class-TrailRenderer.html
    "Define a width value and a curve to control the width of your trail at various points between its start and end. The curve is applied from the beginning to the end of the trail, and sampled at each vertex. The overall width of the curve is controlled by the width value."

    From the script reference:

    https://docs.unity3d.com/ScriptReference/TrailRenderer.html
    "Set the curve describing the width of the trail at various points along its length."

    I think they are both clear. If you can suggest a specific rewording that would improve either I will discuss it with our technical writers.