Trail
Used to create a trail effect between two attachments.
Memory category | Instances |
---|
Member index 19
Removed member index 2
History | Member | |
---|---|---|
295 | P0: Object | |
295 | P1: Object |
Description
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.
History 76
- 645 Change ValueType of Texture from Content to ContentId
- 624 Add
- 573 Change ReturnType of Clear from void to null
- 553 Add
- 553 Change Default of WidthScale from to NumberSequence(0 1 0 1 1 0 )
- 553 Change Default of Transparency from to NumberSequence(0 0.5 0 1 0.5 0 )
- 553 Change Default of TextureMode from to Stretch
- 553 Change Default of TextureLength from to 1
- 553 Change Default of MinLength from to 0.100000001
- 553 Change Default of MaxLength from to 0
- 553 Change Default of LightInfluence from to 0
- 553 Change Default of LightEmission from to 0
- 553 Change Default of Lifetime from to 2
- 553 Change Default of FaceCamera from to false
- 553 Change Default of Enabled from to true
- 553 Change Default of Color from to ColorSequence(0 1 1 1 0 1 1 1 1 0 )
- 553 Change Default of Brightness from to 1
- 553 Change Default of Attachment1 from to
- 553 Change Default of Attachment0 from to
- 498 Add Brightness
- 486 Change ThreadSafety of WidthScale from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Transparency from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextureMode from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TextureLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Texture from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MinLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of LightInfluence from ReadOnly to ReadSafe
- 486 Change ThreadSafety of LightEmission from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Lifetime from ReadOnly to ReadSafe
- 486 Change ThreadSafety of FaceCamera from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Enabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Color from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Attachment1 from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Attachment0 from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Clear from to Unsafe
- 462 Change ThreadSafety of WidthScale from to ReadOnly
- 462 Change ThreadSafety of Transparency from to ReadOnly
- 462 Change ThreadSafety of TextureMode from to ReadOnly
- 462 Change ThreadSafety of TextureLength from to ReadOnly
- 462 Change ThreadSafety of Texture from to ReadOnly
- 462 Change ThreadSafety of MinLength from to ReadOnly
- 462 Change ThreadSafety of MaxLength from to ReadOnly
- 462 Change ThreadSafety of LightInfluence from to ReadOnly
- 462 Change ThreadSafety of LightEmission from to ReadOnly
- 462 Change ThreadSafety of Lifetime from to ReadOnly
- 462 Change ThreadSafety of FaceCamera from to ReadOnly
- 462 Change ThreadSafety of Enabled from to ReadOnly
- 462 Change ThreadSafety of Color from to ReadOnly
- 462 Change ThreadSafety of Attachment1 from to ReadOnly
- 462 Change ThreadSafety of Attachment0 from to ReadOnly
- 331 Add WidthScale
- 329 Change ValueType of Attachment1 from Object to Attachment
- 329 Change ValueType of Attachment0 from Object to Attachment
- 325 Add MaxLength
- 323 Add LightInfluence
- 312 Add Clear
- 311 Remove Clear
- 312 Add Clear
- 296 Add FaceCamera
- 295 Remove P1
- 295 Remove P0
- 295 Add Attachment1
- 295 Add Attachment0
- 294 Add Transparency
- 294 Add TextureMode
- 294 Add TextureLength
- 294 Add Texture
- 294 Add P1
- 294 Add P0
- 294 Add MinLength
- 294 Add LightEmission
- 294 Add Lifetime
- 294 Add Enabled
- 294 Add Color
- 294 Add Trail
Members 19
Attachment0
Type | Default | |
---|---|---|
Attachment |
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 5
- 553 Change Default of Attachment0 from to
- 486 Change ThreadSafety of Attachment0 from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Attachment0 from to ReadOnly
- 329 Change ValueType of Attachment0 from Object to Attachment
- 295 Add Attachment0
Attachment1
Type | Default | |
---|---|---|
Attachment |
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.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 5
- 553 Change Default of Attachment1 from to
- 486 Change ThreadSafety of Attachment1 from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Attachment1 from to ReadOnly
- 329 Change ValueType of Attachment1 from Object to Attachment
- 295 Add Attachment1
Brightness
Type | Default | |
---|---|---|
float | 1 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 2
- 553 Change Default of Brightness from to 1
- 498 Add Brightness
Clear
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
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.
Thread safety | Unsafe |
---|
Color
Type | Default | |
---|---|---|
ColorSequence | 0 1 1 1 0 1 1 1 1 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
Enabled
Type | Default | |
---|---|---|
bool | true |
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.
Thread safety | ReadSafe |
---|---|
Category | Emission |
Loaded/Saved | true |
FaceCamera
Type | Default | |
---|---|---|
bool | false |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of FaceCamera from to false
- 486 Change ThreadSafety of FaceCamera from ReadOnly to ReadSafe
- 462 Change ThreadSafety of FaceCamera from to ReadOnly
- 296 Add FaceCamera
Lifetime
Type | Default | |
---|---|---|
float | 2 |
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.
Thread safety | ReadSafe |
---|---|
Category | Emission |
Loaded/Saved | true |
LightEmission
Type | Default | |
---|---|---|
float | 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of LightEmission from to 0
- 486 Change ThreadSafety of LightEmission from ReadOnly to ReadSafe
- 462 Change ThreadSafety of LightEmission from to ReadOnly
- 294 Add LightEmission
LightInfluence
Type | Default | |
---|---|---|
float | 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of LightInfluence from to 0
- 486 Change ThreadSafety of LightInfluence from ReadOnly to ReadSafe
- 462 Change ThreadSafety of LightInfluence from to ReadOnly
- 323 Add LightInfluence
MaxLength
Type | Default | |
---|---|---|
float | 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Emission |
Loaded/Saved | true |
MinLength
Type | Default | |
---|---|---|
float | 0.100000001 |
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.
Thread safety | ReadSafe |
---|---|
Category | Emission |
Loaded/Saved | true |
Texture
Type | Default | |
---|---|---|
ContentId |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
TextureLength
Type | Default | |
---|---|---|
float | 1 |
Sets the length of the trail's texture, dependent on TextureMode. Changing this property immediately affects all existing and future trail segments.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of TextureLength from to 1
- 486 Change ThreadSafety of TextureLength from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextureLength from to ReadOnly
- 294 Add TextureLength
TextureMode
Type | Default | |
---|---|---|
TextureMode | Stretch |
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.
When TextureMode is set to TextureMode.Stretch, the texture will repeat TextureLength times across the trail's overall length.
Movement
The TextureMode property also affects the movement of the trail's texture as follows:
If set to TextureMode.Stretch, the texture will stretch out based on the lifetime of the trail, and shrink inwards if the trail's attachments stop moving.
If set to TextureMode.Wrap, the texture will be tiled as the length of the trail changes, but the textures will remain stationary relative to their attachments.
If set to TextureMode.Static, the texture will be rolled out as the attachments move, and they will remain in place until their lifetime is met. This setting is ideal for trail textures that should appear "stamped" where rendered, such as paw prints or tire tracks.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of TextureMode from to Stretch
- 486 Change ThreadSafety of TextureMode from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TextureMode from to ReadOnly
- 294 Add TextureMode
Transparency
Type | Default | |
---|---|---|
NumberSequence | 0 0.5 0 1 0.5 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
History 4
- 553 Change Default of Transparency from to NumberSequence(0 0.5 0 1 0.5 0 )
- 486 Change ThreadSafety of Transparency from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Transparency from to ReadOnly
- 294 Add Transparency
WidthScale
Type | Default | |
---|---|---|
NumberSequence | 0 1 0 1 1 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Emission |
Loaded/Saved | true |
History 4
- 553 Change Default of WidthScale from to NumberSequence(0 1 0 1 1 0 )
- 486 Change ThreadSafety of WidthScale from ReadOnly to ReadSafe
- 462 Change ThreadSafety of WidthScale from to ReadOnly
- 331 Add WidthScale