• Studio

  • Studio API

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • TrailRenderer

    Inherits from: Renderer

    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

    time

    number

    Retrieves or sets the duration in seconds that the trail takes to fade away completely.

    Determines the starting width of the trail at its base.

    endWidth

    number

    Specifies the ending width of the trail at its tip.

    Scales the width of the trail uniformly.

    Enables or disables automatic destruction of the trail renderer when it finishes emitting particles.

    emitting

    boolean

    Indicates whether the trail renderer is currently emitting particles.

    Sets the number of vertices to use for each corner of the trail.

    Specifies the number of vertices for each cap of the trail.

    Defines the minimum distance between consecutive vertices in the trail.

    Determines the color of the trail at its start.

    Specifies the color of the trail at its end.

    Provides the number of positions in the trail's vertex array.

    Sets the tiling of the trail's texture along its length.

    Adjusts the distance of the shadow cast by the trail from the visible geometry.

    Enables or disables the generation of lighting data for the trail.

    Defines a curve that modifies the width of the trail along its length.

    Methods

    Updates the position of a specific vertex in the trail.

    Parameters

    index

    number

    The index of the vertex to update.

    position
    Vector3

    The new position for the vertex.

    Returns

    void

    This method does not return a value.

    Retrieves the position of a vertex in the trail.

    Parameters

    index

    number

    The index of the vertex to retrieve.

    Returns

    Vector3

    The position of the specified vertex.

    Clears all positions and resets the trail to its initial state.

    Returns

    void

    This method does not return a value.

    Generates a mesh based on the current trail configuration.

    Parameters

    mesh
    Mesh

    The mesh to bake the trail into.

    useTransform

    boolean

    Flag indicating whether to transform the mesh into world space.

    Returns

    void

    This method does not return a value.

    Adds a new position to the trail, creating a continuous line.

    Parameters

    position
    Vector3

    The new position to add.

    Returns

    void

    This method does not return a value.

    Updated about 1 month ago

    PocketWorlds Icon

    © 2024 Pocket Worlds. All rights reserved.