TrailRenderer is a Unity component that creates visually appealing trails behind moving objects, like the tail of a comet streaking through the sky. These trails can enhance the realism of fast-paced games or add visual flair to various effects. Dive into the Unity's TrailRenderer Documentation to explore its capabilities in more detail.
Properties
Enables or disables automatic destruction of the trail renderer when it finishes emitting particles. Unity's TrailRenderer.autodestruct Documentation
Indicates whether the trail renderer is currently emitting particles. Unity's TrailRenderer.emitting Documentation
Specifies the color of the trail at its end. Unity's TrailRenderer.endColor Documentation
Specifies the ending width of the trail at its tip. Unity's TrailRenderer.endWidth Documentation
Enables or disables the generation of lighting data for the trail. Unity's TrailRenderer.generateLightingData Documentation
Defines the minimum distance between consecutive vertices in the trail. Unity's TrailRenderer.minVertexDistance Documentation
Specifies the number of vertices for each cap of the trail. Unity's TrailRenderer.numCapVertices Documentation
Sets the number of vertices to use for each corner of the trail. Unity's TrailRenderer.numCornerVertices Documentation
Provides the number of positions in the trail's vertex array. Unity's TrailRenderer.positionCount Documentation
Adjusts the distance of the shadow cast by the trail from the visible geometry. Unity's TrailRenderer.shadowBias Documentation
Determines the color of the trail at its start. Unity's TrailRenderer.startColor Documentation
Determines the starting width of the trail at its base. Unity's TrailRenderer.startWidth Documentation
Sets the tiling of the trail's texture along its length. Unity's TrailRenderer.textureScale Documentation
Retrieves or sets the duration in seconds that the trail takes to fade away completely. Unity's TrailRenderer.time Documentation
Defines a curve that modifies the width of the trail along its length. Unity's TrailRenderer.widthCurve Documentation
Scales the width of the trail uniformly. Unity's TrailRenderer.widthMultiplier Documentation
Methods
Adds a new position to the trail, creating a continuous line. Unity's TrailRenderer.AddPosition Documentation
Parameters
position
The new position to add.
Returns
Parameters
positions
Returns
Generates a mesh based on the current trail configuration. Unity's TrailRenderer.BakeMesh Documentation
Generates a mesh based on the current trail configuration. Unity's TrailRenderer.BakeMesh Documentation
Generates a mesh based on the current trail configuration. Unity's TrailRenderer.BakeMesh Documentation
Parameters
mesh
The mesh to bake the trail into.
useTransform
Flag indicating whether to transform the mesh into world space.
Returns
Clears all positions and resets the trail to its initial state. Unity's TrailRenderer.Clear Documentation
Returns
Retrieves the position of a vertex in the trail. Unity's TrailRenderer.GetPosition Documentation
Parameters
index
The index of the vertex to retrieve.
Returns
The position of the specified vertex.
Updates the position of a specific vertex in the trail. Unity's TrailRenderer.SetPosition Documentation
Parameters
index
The index of the vertex to update.
position
The new position for the vertex.
Returns
Parameters
positions
Returns
Updated 9 days ago