# TrailRenderer Trail renderer

The trail renderer component will render a trail as the position of the moving Entity, which can be used to give a sense of emphasis to the movement of the moving object, or to highlight the path or the position of the moving object.

# In the IDE

To create in the IDE, you only need to select a node in the scene or Prefab and add it in the Inspector:

# Create with code

TrailRenderer is a rendering component, so it needs to be mounted on a non-rendering node.

entity.addComponent(engine.TrailRenderer);

# Attributes

Property name Type Default value Description
startWidth number 1 starting width
endWidth number 1 End width
widthCurve engine.HermiteCurve Width is 1 without gradient Width change curve
time number 5 wake duration
gColor engine.GradientColor White Gradient color from start to end
minVertexDistance number 0.1 The minimum distance of each point in the wake
alignment TrailAlignment TrailAlignment.View Currently only the trail is always facing the camera
    View - engine.TrailRenderer.TrailAlignment.View Facing the camera plane.
    Local - engine.TrailRenderer.TrailAlignment.Local Align with the transform of the Entity.
textureMode TrailTextureMode TrailTextureMode.Stretch The way the texture is displayed
    Stretch - engine.TrailRenderer.TrailTextureMode.Stretch Only one texture is used for the entire trail.
    Tile - engine.TrailRenderer.TrailTextureMode.Tile Use a texture between every two points