Ghi chú phát hành
Học
Lớp công cụ
Trail

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.


Mẫu mã
Tạo một Phần với một Đường Dẫn Cơ Bản
local TweenService = game:GetService("TweenService")
-- Tạo một phần cha
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
-- Tạo các gắn trên phần
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
-- Tạo một đường dẫn mới
local trail = Instance.new("Trail")
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
trail.Parent = part
-- Tween phần để hiển thị đường dẫn
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

Tài Liệu Tham Khảo API
Thuộc Tính
Attachment0
Đọc Song Song
Các khả năng: Basic
Trail.Attachment0:Attachment

Attachment1
Đọc Song Song
Các khả năng: Basic
Trail.Attachment1:Attachment

Brightness
Đọc Song Song
Các khả năng: Basic
Trail.Brightness:number

Color
Đọc Song Song
Các khả năng: Basic
Trail.Color:ColorSequence
Mẫu mã
Tạo Đường Đua với Gradient Màu Sắc
local TweenService = game:GetService("TweenService")
-- Tạo một phần cha
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
-- Tạo các attachment trên phần
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
-- Tạo một đường đua mới với gradient màu sắc
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 phần để hiển thị đường đua
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
Đọc Song Song
Các khả năng: Basic
Trail.Enabled:boolean

FaceCamera
Đọc Song Song
Các khả năng: Basic
Trail.FaceCamera:boolean

Lifetime
Đọc Song Song
Các khả năng: Basic
Trail.Lifetime:number

LightEmission
Đọc Song Song
Các khả năng: Basic
Trail.LightEmission:number

LightInfluence
Đọc Song Song
Các khả năng: Basic
Trail.LightInfluence:number

LocalTransparencyModifier
Ẩn
Không Sao Chép
Đọc Song Song
Các khả năng: Basic
Trail.LocalTransparencyModifier:number

MaxLength
Đọc Song Song
Các khả năng: Basic
Trail.MaxLength:number

MinLength
Đọc Song Song
Các khả năng: Basic
Trail.MinLength:number

Texture
Đọc Song Song
Các khả năng: Basic
Trail.Texture:ContentId
Mẫu mã
Tạo một Đường Dẫn với Kết Cấu Dấu Chân
local TweenService = game:GetService("TweenService")
-- Tạo một phần cha
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
-- Tạo các điểm gắn trên phần
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
-- Tạo một đường dẫn mới với độ chuyển màu
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 phần để hiển thị đường dẫn
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
Đọc Song Song
Các khả năng: Basic
Trail.TextureLength:number

TextureMode
Đọc Song Song
Các khả năng: Basic
Trail.TextureMode:Enum.TextureMode

Transparency
Đọc Song Song
Các khả năng: Basic
Trail.Transparency:NumberSequence

WidthScale
Đọc Song Song
Các khả năng: Basic
Trail.WidthScale:NumberSequence

Phương Pháp
Clear
Các khả năng: Basic
Trail:Clear():()
Lợi Nhuận
()

©2026 Roblox Corporation. Roblox, logo Roblox và Powering Imagination là các nhãn hiệu đã đăng ký và chưa đăng ký của chúng tôi tại Hoa Kỳ và các quốc gia khác.