15 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

Trail

Inherits from: Instance → Object

The Trail object is used to create a trail effect between two attachments. As the attachments move through space, a texture is drawn on their defined plane. This is commonly used to create effects that visualize movements like tracer trails behind projectiles, footprints, tire tracks, and similar effects.

See Trails for more information.

Inherits from: Instance

Memory category: Instances

Code samples: View on Creator Hub (creating-a-part-with-a-basic-trail).

Properties

NameType / ReturnsDescription
Trail.Attachment0AttachmentAlong with Attachment1, determines where the trail will start drawing its segments.
Trail.Attachment1AttachmentAlong with Attachment0, determines where the trail will start drawing its segments.
Trail.BrightnessfloatScales the light emitted from the trail when LightInfluence is less than 1.
Trail.ColorColorSequenceThe color of the trail throughout its lifetime.
Trail.EnabledbooleanDetermines whether the trail will be drawn or not.
Trail.FaceCamerabooleanDetermines whether the trail will always face the camera, regardless of its orientation.
Trail.LifetimefloatDetermines how long each segment in a trail will last, in seconds.
Trail.LightEmissionfloatDetermines to what degree the colors of the trail are blended with the colors behind it.
Trail.LightInfluencefloatDetermines the degree to which the trail is influenced by the environment's lighting.
Trail.LocalTransparencyModifierfloatDetermines a multiplier for Trail.Transparency that is only visible to the local client.
Trail.MaxLengthfloatSets the maximum length of the trail.
Trail.MinLengthfloatSets the minimum length of the trail.
Trail.TextureContentIdThe content ID of the texture to be displayed on the trail.
Trail.TextureContentContentThe texture displayed on the trail. Supports asset URIs.
Trail.TextureLengthfloatSets the length of the trail's texture, dependent on TextureMode.
Trail.TextureModeTextureModeDetermines the manner in which the Texture scales, repeats, and moves along with the trail's attachments.
Trail.TransparencyNumberSequenceSets the transparency of the trail's segments over its Lifetime.
Trail.WidthScaleNumberSequenceScales the width of the trail over the course of its lifetime.

Inherited from Instance

NameType / ReturnsDescription
Instance.ArchivablebooleanDetermines if an Instance and its descendants can be cloned using Instance:Clone(), and can be saved/published.
Instance.archivableboolean
Instance.CapabilitiesSecurityCapabilitiesThe set of capabilities allowed to be used for scripts inside this container.
Instance.IsInSandboxbooleanIndicates whether the instance is inside a sandboxed container.
Instance.NamestringA non-unique identifier of the Instance.
Instance.ParentInstanceDetermines the hierarchical parent of the Instance.
Instance.PredictionModePredictionModeReflects the client-side prediction mode applied to the instance under server-authoritative physics.
Instance.RobloxLockedbooleanA deprecated property that used to protect CoreGui objects.
Instance.SandboxedbooleanWhen enabled, the instance can only access abilities in its Capabilities list.
Instance.UniqueIdUniqueIdA unique identifier for the instance.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

Trail.Attachment0

A Trail starts drawing its segments at the positions of its Attachment0 and Attachment1. When the trail is Enabled, it records the positions of its attachments every frame and connects these positions to the attachments' positions on the previous frame, creating a polygon that is then filled in by the trail's Color and Texture.

Changing the attachments of a trail while a trail is drawing will remove all of the segments the trail has already drawn.

FieldValue
typeAttachment
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.Attachment1

A Trail starts drawing its segments at the positions of its Attachment0 and Attachment1. When the trail is Enabled, it records the positions of its attachments every frame and connects these positions to the attachments' positions on the previous frame, creating a polygon that is then filled in by the trail's Color and Texture.

Changing the attachments of a trail while a trail is drawing will remove all of the segments the trail has already drawn.

FieldValue
typeAttachment
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.Brightness

Scales the light emitted from the trail when LightInfluence is less than 1. This property is 1 by default and can set to any number within the range of 0 to 10000. Increasing the value of LightInfluence decreases the effect of this property's value.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.Color

Determines the color of the trail throughout its lifetime. If Texture is set, this color will tint the texture.

This property is a ColorSequence, allowing the color to be configured to vary across the length of the trail. If the color changes after some of the trail segments have been drawn, all of the old segments will be updated to match the new colors.

FieldValue
typeColorSequence
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Code samples: View on Creator Hub (creating-a-trail-with-a-color-gradient).

Trail.Enabled

This property determines whether the trail will be drawn or not.

If set to false while a trail is drawing, no new segments will be drawn, but any existing segments will be cleaned up naturally when they reach the end of their Lifetime. To forcibly clean up existing segments, call the Clear() method at the same time.

FieldValue
typeboolean
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryEmission
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.FaceCamera

A Trail is a 2D projection existing in 3D space, meaning that it may not be visible from every angle. The FaceCamera property, when set to true, ensures that the trail always faces the CurrentCamera, regardless of its orientation.

Changing this property immediately affects all existing and future trail segments.

FieldValue
typeboolean
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.Lifetime

The Lifetime property determines how long each segment in a trail will last, in seconds, before it disappears. Defaults to 2 seconds but can be set anywhere between 0.01 and 20.

The lifetime of a trail is also used by that effect's Color and Transparency properties to determine how each segment is drawn. Both of these properties are sequences, meaning that they define their values at certain keypoints in the segment's lifetime and then interpolate between the values as the segment ages.

If a trail's lifetime changes, existing segments will immediately behave as if they always had the new lifetime, meaning that if they've existed for longer than the new lifetime, they will be removed immediately.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryEmission
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.LightEmission

Determines to what degree the colors of the trail are blended with the colors behind it. It should be set in the range of 0 to 1. A value of 0 uses normal blending modes and a value of 1 uses additive blending.

This property should not be confused with LightInfluence which determines how the trail is affected by environmental light.

Changing this property immediately affects all existing and future segments of the trail.

This property does not cause the trail to light the environment.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.LightInfluence

Determines the degree to which the trail is influenced by the environment's lighting, clamped between 0 and 1. When 0, the trail will be unaffected by the environment's lighting. When 1, it will be fully affected by lighting as a BasePart would be.

Changing this property immediately affects all existing and future segments of the trail.

See also LightEmission which specifies to what degree the colors of the trail are blended with the colors behind it.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.LocalTransparencyModifier

The LocalTransparencyModifier property is a multiplier applied to the trail's Transparency that is only visible to the local client. It does not replicate from client to server and is useful for when a trail should not render for a specific client.

Uses the same formula as BasePart.LocalTransparencyModifier:

1 - ((1 - Transparency) × (1 - LocalTransparencyModifier))

A value of 0 (default) has no effect on the trail's transparency. A value of 1 makes the trail completely invisible to the local client regardless of its Transparency value.

FieldValue
typefloat
tags["Hidden","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":false,"can_save":false}
capabilities["Basic"]

Trail.MaxLength

This property determines the maximum length of the trail, in studs. Its value defaults to 0, meaning that the trail will not have a maximum length and trail segments will expire in their Lifetime.

This property can be used alongside the MinLength property which determines the minimum length a trail must be before it's drawn.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryEmission
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.MinLength

This property determines the minimum length of the trail, in studs. If neither of the trail's attachments have moved at least this value, no new segments will be created and the endpoints of the current segment will be moved to the current position of the attachments.

Note that changing this property will only affect new segments that are drawn; any old segments that have already been drawn will maintain their current length.

This property can be used alongside the MaxLength property which determines the maximum trail length before its oldest segments are erased.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryEmission
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.Texture

The content ID of the texture to be displayed on the trail. If this property is not set, the trail will be displayed as a solid plane; this also occurs when the texture is set to an invalid content ID or the image associated with the texture has not yet loaded.

The appearance of the texture can be further modified by other trail properties including Color and Transparency.

Scaling of the texture is determined by the distance between Attachment0 and Attachment1, as well as the TextureMode, TextureLength, and WidthScale properties.

FieldValue
typeContentId
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Code samples: View on Creator Hub (creating-a-trail-with-a-pawprint-texture).

Trail.TextureContent

The texture displayed on the trail. Supports asset URIs.

This property is the Content equivalent of Texture. Assigning TextureContent updates Texture.

If this property is set to Content.none, the trail displays as a solid plane colored by its Color property. The appearance of the texture can be further modified by Color and Transparency. Scaling of the texture is determined by the distance between Attachment0 and Attachment1, as well as TextureMode, TextureLength, and WidthScale.

FieldValue
typeContent
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.TextureLength

Sets the length of the trail's texture, dependent on TextureMode. Changing this property immediately affects all existing and future trail segments.

FieldValue
typefloat
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.TextureMode

This property, alongside TextureLength, determines how a trail's Texture scales, repeats, and moves along with the trail's attachments. Changing this property immediately affects all existing and future trail segments.

Scale and Repetition

When TextureMode is set to TextureMode.Wrap or TextureMode.Static, the TextureLength property sets the length of the texture as it repeats across the trail's length.

TextureMode diagram with Wrap mode

When TextureMode is set to TextureMode.Stretch, the texture will repeat TextureLength times across the trail's overall length.

TextureMode diagram with Stretch mode

Movement

The TextureMode property also affects the movement of the trail's texture as follows:

FieldValue
typeTextureMode
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.Transparency

Sets the transparency of the trail's segments over its Lifetime. This value is a NumberSequence, meaning it can be a static value or can change throughout the lifetime of the trail segments.

FieldValue
typeNumberSequence
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryAppearance
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Trail.WidthScale

This property is a NumberSequence that scales the width of the trail over the course of its lifetime. Values can range between 0 and 1, acting as a multiplier on the distance between the trail's attachments. For example, if the trail's attachments are 2 stud's apart and the value of this property is 0.5, the trail's width will be 1 stud and the trail will be centered between the two attachments.

FieldValue
typeNumberSequence
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryEmission
serialization{"can_load":true,"can_save":true}
capabilities["Basic"]

Methods

NameType / ReturnsDescription
Trail:Clear()Clears the segments of the trail.

Inherited from Instance

NameType / ReturnsDescription
Instance:AddTag()Applies a tag to the instance.
Instance:childrenInstancesReturns an array of the object's children.
Instance:ClearAllChildren()This method destroys all of an instance's children.
Instance:CloneInstanceCreate a copy of an instance and all its descendants, ignoring instances that are not Archivable.
Instance:cloneInstance
Instance:Destroy()Sets the Instance.Parent property to nil, locks the Instance.Parent property, disconnects all connections, and calls Destroy() on all children.
Instance:destroy()
Instance:FindFirstAncestorInstance?Returns the first ancestor of the Instance whose Instance.Name is equal to the given name.
Instance:FindFirstAncestorOfClassInstance?Returns the first ancestor of the Instance whose Object.ClassName is equal to the given className.
Instance:FindFirstAncestorWhichIsAInstance?Returns the first ancestor of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstChildInstance?Returns the first child of the Instance found with the given name.
Instance:findFirstChildInstance
Instance:FindFirstChildOfClassInstance?Returns the first child of the Instance whose ClassName is equal to the given class name.
Instance:FindFirstChildWhichIsAInstance?Returns the first child of the Instance for whom Object:IsA() returns true for the given className.
Instance:FindFirstDescendantInstance?Returns the first descendant found with the given Instance.Name.
Instance:GetActorActor?Returns the Actor associated with the Instance, if any.
Instance:GetAttributeVariantReturns the value which has been assigned to the given attribute name.
Instance:GetAttributeChangedSignalRBXScriptSignalReturns an event that fires when the given attribute changes.
Instance:GetAttributesDictionaryReturns a dictionary of the instance's attributes.
Instance:GetChildrenInstancesReturns an array containing all of the instance's children.
Instance:getChildrenInstances
Instance:GetDebugIdstringReturns a coded string of the debug ID used internally by Roblox.
Instance:GetDescendantsInstancesReturns an array containing all of the descendants of the instance.
Instance:GetFullNamestringReturns a string describing the instance's ancestry.
Instance:GetStyledVariantReturns the styled or explicitly modified value of the specified property, or else the default property value if it hasn't been styled/modified.
Instance:GetStyledPropertyChangedSignalRBXScriptSignalReturns an event that fires when the given style property changes on the instance.
Instance:GetTagsArrayGets an array of all tags applied to the instance.
Instance:HasTagbooleanCheck whether the instance has a given tag.
Instance:IsAncestorOfbooleanReturns true if an Instance is an ancestor of the given descendant.
Instance:IsDescendantOfbooleanReturns true if an Instance is a descendant of the given ancestor.
Instance:isDescendantOfboolean
Instance:IsPropertyModifiedbooleanReturns true if the value stored in the specified property is not equal to the code-instantiated default.
Instance:QueryDescendantsInstancesReturns an array containing all descendants of the instance that match the selector string.
Instance:Remove()Sets the object's Parent to nil, and does the same for all its descendants.
Instance:remove()
Instance:RemoveTag()Removes a tag from the instance.
Instance:ResetPropertyToDefault()Resets a property to its default value.
Instance:SetAttribute()Sets the attribute with the given name to the given value.
Instance:WaitForChildInstanceReturns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

Trail:Clear

This method immediately clears all segments of the trail and is useful for cleaning up trails with longer lifetimes or for cases where the trail should be removed because of a specific action.

Calling this method only affects existing segments. To clear existing trail segments and temporarily prevent new segments from being drawn, toggle the trail's Enabled property to false at the same time.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Basic"]

Events

Inherited from Instance

NameType / ReturnsDescription
Instance.AncestryChangedFires when the Instance.Parent property of this object or one of its ancestors is changed.
Instance.AttributeChangedFires whenever an attribute is changed on the Instance.
Instance.ChildAddedFires after an object is parented to this Instance.
Instance.childAdded
Instance.ChildRemovedFires after a child is removed from this Instance.
Instance.DescendantAddedFires after a descendant is added to the Instance.
Instance.DescendantRemovingFires immediately before a descendant of the Instance is removed.
Instance.DestroyingFires immediately before (or is deferred until after) the instance is destroyed via Instance:Destroy().
Instance.StyledPropertiesChangedFires whenever any style property is changed on the instance, including when a property is set to nil.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.