Trail
Trail : Instance
Overview
This instance creates an afterimage (trail) effect following a moving object, used for effects such as energy blade effect, speed boosts, magical trails, or bullet traces.
This can be parented to a specific object like a Part to display effects based on that object's movement.
Properties
Color
ColorSequence
A ColorSequence can be used to control the color of a trail as Trail appears and gradually fades out.
If a texture is applied to the Trail, this color is overlaid on the texture.
Code Samples
local Trail = script.Parent
Trail.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0))
ColorTexture
string
This property specifies the color texture to be displayed on the Trail.
Code Samples
local Trail = script.Parent
Trail.ColorTexture = "ovdrassetid://1234"
ColorTextureLength
number
This property specifies the length of the color texture applied to the Trail.
Code Samples
local Trail = script.Parent
Trail.ColorTextureLength = 5
ColorTextureSpeed
number
CThis property specifies the speed of the color texture applied to the Trail.
Code Samples
local Trail = script.Parent
Trail.ColorTextureSpeed = 10
AlphaTexture
string
This property specifies the alpha texture to be displayed on the Trail.
Code Samples
local Trail = script.Parent
Trail.AlphaTexture = "ovdrassetid://1234"
AlphaTextureLength
number
This property specifies the length of the alpha texture applied to the Trail.
Code Samples
local Trail = script.Parent
Trail.AlphaTextureLength = 5
AlphaTextureSpeed
number
This property specifies the speed of the alpha texture applied to the Trail.
Code Samples
local Trail = script.Parent
Trail.AlphaTextureSpeed = 10
Transparency
NumberSequence
When the Trail appears and fades out, a NumberSequence can be used to control how its transparency gradually changes.
Code Samples
local Trail = script.Parent
Trail.Transparency = NumberSequence.new(0.8)
Enabled
bool
This property specifies whether the Trail is displayed.
If the property is changed from Enabled to false while the Trail is still visible, the Trail disappears instantly.
Code Samples
local Trail = script.Parent
Trail.Enabled = false
Lifetime
number
This property specifies how many seconds the Trail's trace persists.
Code Samples
local Trail = script.Parent
Trail.LifeTime = 0.5
Width
number
This property specifies the width of the Trail.
Code Samples
local Trail = script.Parent
Trail.Width = 100
WidthScale
NumberSequence
A NumberSequence can be used to control how the Trail's width gradually changes.
Code Samples
local Trail = script.Parent
Trail.WidthScale = NumberSequence.new(3)
Offset
Vector3
This property adjusts the Trail's position relative to its parent object.
Code Samples
local Trail = script.Parent
Trail.Offset = Vector3.new(0, 100, 0)
Methods
Events
See also
VFXLast updated