Aprender
Clase de motor
Trail

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.


Muestras de código
Creación de una Parte con un Rastro Básico
local TweenService = game:GetService("TweenService")
-- Crear una parte padre
local part = Instance.new("Part")
part.Material = Enum.Material.SmoothPlastic
part.Size = Vector3.new(4, 1, 2)
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Parent = workspace
-- Crear attachments en la parte
local attachment0 = Instance.new("Attachment")
attachment0.Name = "Attachment0"
attachment0.Position = Vector3.new(-2, 0, 0)
attachment0.Parent = part
local attachment1 = Instance.new("Attachment")
attachment1.Name = "Attachment1"
attachment1.Position = Vector3.new(2, 0, 0)
attachment1.Parent = part
-- Crear un nuevo rastro
local trail = Instance.new("Trail")
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
trail.Parent = part
-- Animar la parte para mostrar el rastro
local dir = 15
while true do
dir *= -1
local goal = { Position = part.Position + Vector3.new(0, 0, dir) }
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
task.wait(4)
end

Referencia API
Propiedades
Attachment0
Leer paralelo
Capacidades: Basic
Trail.Attachment0:Attachment

Attachment1
Leer paralelo
Capacidades: Basic
Trail.Attachment1:Attachment

Brightness
Leer paralelo
Capacidades: Basic
Trail.Brightness:number

Color
Leer paralelo
Capacidades: Basic
Trail.Color:ColorSequence
Muestras de código
Creando un rastro con un degradado de color
local TweenService = game:GetService("TweenService")
-- Crear una parte padre
local part = Instance.new("Part")
part.Material = Enum.Material.SmoothPlastic
part.Size = Vector3.new(4, 1, 2)
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Parent = workspace
-- Crear uniones en la parte
local attachment0 = Instance.new("Attachment")
attachment0.Name = "Attachment0"
attachment0.Position = Vector3.new(-2, 0, 0)
attachment0.Parent = part
local attachment1 = Instance.new("Attachment")
attachment1.Name = "Attachment1"
attachment1.Position = Vector3.new(2, 0, 0)
attachment1.Parent = part
-- Crear un nuevo rastro con degradado de color
local trail = Instance.new("Trail")
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
local color1 = Color3.fromRGB(255, 0, 0)
local color2 = Color3.fromRGB(0, 0, 255)
trail.Color = ColorSequence.new(color1, color2)
trail.Parent = part
-- Tween de la parte para mostrar el rastro
local dir = 15
while true do
dir *= -1
local goal = { Position = part.Position + Vector3.new(0, 0, dir) }
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
task.wait(4)
end

Enabled
Leer paralelo
Capacidades: Basic
Trail.Enabled:boolean

FaceCamera
Leer paralelo
Capacidades: Basic
Trail.FaceCamera:boolean

Lifetime
Leer paralelo
Capacidades: Basic
Trail.Lifetime:number

LightEmission
Leer paralelo
Capacidades: Basic
Trail.LightEmission:number

LightInfluence
Leer paralelo
Capacidades: Basic
Trail.LightInfluence:number

LocalTransparencyModifier
Oculto
No replicado
Leer paralelo
Capacidades: Basic
Trail.LocalTransparencyModifier:number

MaxLength
Leer paralelo
Capacidades: Basic
Trail.MaxLength:number

MinLength
Leer paralelo
Capacidades: Basic
Trail.MinLength:number

Texture
Leer paralelo
Capacidades: Basic
Trail.Texture:ContentId
Muestras de código
Creando una estela con una textura de huella de paw
local TweenService = game:GetService("TweenService")
-- Crear una parte padre
local part = Instance.new("Part")
part.Material = Enum.Material.SmoothPlastic
part.Size = Vector3.new(2, 1, 2)
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Parent = workspace
-- Crear uniones en la parte
local attachment0 = Instance.new("Attachment")
attachment0.Name = "Attachment0"
attachment0.Position = Vector3.new(-1, 0, 0)
attachment0.Parent = part
local attachment1 = Instance.new("Attachment")
attachment1.Name = "Attachment1"
attachment1.Position = Vector3.new(1, 0, 0)
attachment1.Parent = part
-- Crear una nueva estela con gradiente de color
local trail = Instance.new("Trail")
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
trail.Texture = "rbxassetid://16178262222"
trail.TextureMode = Enum.TextureMode.Static
trail.TextureLength = 2
trail.Parent = part
-- Tween parte para mostrar la estela
local dir = 15
while true do
dir *= -1
local goal = { Position = part.Position + Vector3.new(0, 0, dir) }
local tweenInfo = TweenInfo.new(3)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
task.wait(4)
end

TextureLength
Leer paralelo
Capacidades: Basic
Trail.TextureLength:number

TextureMode
Leer paralelo
Capacidades: Basic
Trail.TextureMode:Enum.TextureMode

Transparency
Leer paralelo
Capacidades: Basic
Trail.Transparency:NumberSequence

WidthScale
Leer paralelo
Capacidades: Basic
Trail.WidthScale:NumberSequence

Métodos
Clear
Capacidades: Basic
Trail:Clear():()
Devuelve
()

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.