เรียนรู้
Engine Class
Trail

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
วิธีการ
Clear():()
สมาชิกที่ได้รับทอด
ตัวอย่างโค้ด
การสร้างส่วนประกอบพร้อมกับเส้นทางพื้นฐาน
local TweenService = game:GetService("TweenService")
-- สร้างส่วนประกอบพาเรนต์
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
-- สร้างการติดตั้งบนส่วนประกอบ
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
-- สร้างเส้นทางใหม่
local trail = Instance.new("Trail")
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
trail.Parent = part
-- ย้ายส่วนประกอบเพื่อแสดงเส้นทาง
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

เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
Attachment0
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Attachment0:Attachment

Attachment1
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Attachment1:Attachment

Brightness
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Brightness:number

Color
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Color:ColorSequence
ตัวอย่างโค้ด
สร้างเส้นทางด้วยการไล่สี
local TweenService = game:GetService("TweenService")
-- สร้างชิ้นส่วนหลัก
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
-- สร้างการติดตั้งบนชิ้นส่วน
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
-- สร้างเส้นทางใหม่ด้วยการไล่สี
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 ชิ้นส่วนเพื่อแสดงเส้นทาง
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
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Enabled:boolean

FaceCamera
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.FaceCamera:boolean

Lifetime
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Lifetime:number

LightEmission
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.LightEmission:number

LightInfluence
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.LightInfluence:number

LocalTransparencyModifier
ซ่อนอยู่
ไม่ซ้ำ
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.LocalTransparencyModifier:number

MaxLength
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.MaxLength:number

MinLength
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.MinLength:number

Texture
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Texture:ContentId
ตัวอย่างโค้ด
สร้างเส้นทางด้วยพื้นผิวรอยเท้า
local TweenService = game:GetService("TweenService")
-- สร้างส่วนหลัก
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
-- สร้างการยึดเกาะบนส่วน
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
-- สร้างเส้นทางใหม่ด้วยการไล่ระดับสี
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
-- ทำให้ส่วนเคลื่อนไหวเพื่อแสดงเส้นทาง
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
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.TextureLength:number

TextureMode
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.TextureMode:Enum.TextureMode

Transparency
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.Transparency:NumberSequence

WidthScale
อ่านพร้อมๆ กัน
ความสามารถ: Basic
Trail.WidthScale:NumberSequence

วิธีการ
Clear
ความสามารถ: Basic
Trail:Clear():()
ส่งค่ากลับ
()

©2026 Roblox Corporation. Roblox, โลโก้ Roblox และ Powering Imagination เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ