เรียนรู้
Engine Class
KeyframeSequenceProvider
เลิกใช้แล้ว
ไม่สามารถสร้าง
บริการ
ไม่ซ้ำ

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


สรุป
วิธีการ
GetAnimations(userId: User):Instance
เลิกใช้แล้ว
GetKeyframeSequence(assetId: ContentId):Instance
เลิกใช้แล้ว
GetKeyframeSequenceById(assetId: number,useCache: boolean):Instance
เลิกใช้แล้ว
RegisterActiveKeyframeSequence(keyframeSequence: Instance):ContentId
RegisterKeyframeSequence(keyframeSequence: Instance):ContentId
สมาชิกที่ได้รับทอด
ตัวอย่างโค้ด
สร้างแอนิเมชันชั่วคราว
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local function createPreviewAnimation(keyframeSequence)
local hashId = KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence)
local Animation = Instance.new("Animation")
Animation.AnimationId = hashId
return Animation
end
local keyframeSequence = Instance.new("KeyframeSequence")
local animation = createPreviewAnimation(keyframeSequence)
print(animation)

เอกสารอ้างอิงเกี่ยวกับ API
วิธีการ
GetAnimations
เลิกใช้แล้ว

GetAnimationsAsync
ผลตอบแทน
ความสามารถ: Animation
KeyframeSequenceProvider:GetAnimationsAsync(userId:User):Instance
พารามิเตอร์
userId:User
ส่งค่ากลับ
ตัวอย่างโค้ด
KeyframeSequenceProvider GetAnimationsAsync
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local USER_ID = 0 -- ใส่ UserId ของคุณที่นี่
local function extractPages(pagesObject)
local array = {}
while true do
local thisPage = pagesObject:GetCurrentPage()
for _, v in pairs(thisPage) do
table.insert(array, v)
end
if pagesObject.IsFinished then
break
end
pagesObject:AdvanceToNextPageAsync()
end
return array
end
local inventoryPages = KeyframeSequenceProvider:GetAnimationsAsync(USER_ID)
local animationIds = extractPages(inventoryPages)
for _, id in pairs(animationIds) do
print(id)
end
print("ทั้งหมด: ", #animationIds)

GetKeyframeSequence
เลิกใช้แล้ว

GetKeyframeSequenceAsync
ผลตอบแทน
ความสามารถ: Animation
KeyframeSequenceProvider:GetKeyframeSequenceAsync(assetId:ContentId):Instance
พารามิเตอร์
assetId:ContentId
ส่งค่ากลับ
ตัวอย่างโค้ด
การสร้าง KeyframeSequence ของการแอนิเมชัน
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local ANIMATION_ID = "rbxassetid://507771019"
-- ดึง KeyframeSequence สำหรับ asset
local keyframeSequence
local success, err = pcall(function()
keyframeSequence = KeyframeSequenceProvider:GetKeyframeSequenceAsync(ANIMATION_ID)
end)
if success then
-- ทำซ้ำแต่ละ keyframe และพิมพ์ค่าเวลาของมัน
local keyframeTable = keyframeSequence:GetKeyframes()
for key, value in keyframeTable do
print(`เวลาของ keyframe หมายเลข {key} คือ: {value.Time}`)
end
else
print(`เกิดข้อผิดพลาดในการดึง KeyframeSequence: {err}`)
end

GetKeyframeSequenceById
เลิกใช้แล้ว

RegisterActiveKeyframeSequence
ความสามารถ: Animation
KeyframeSequenceProvider:RegisterActiveKeyframeSequence(keyframeSequence:Instance):ContentId
พารามิเตอร์
keyframeSequence:Instance
ส่งค่ากลับ
ContentId
ตัวอย่างโค้ด
สร้างแอนิเมชันชั่วคราว
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local function createPreviewAnimation(keyframeSequence)
local hashId = KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence)
local Animation = Instance.new("Animation")
Animation.AnimationId = hashId
return Animation
end
local keyframeSequence = Instance.new("KeyframeSequence")
local animation = createPreviewAnimation(keyframeSequence)
print(animation)

RegisterKeyframeSequence
ความสามารถ: Animation
KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence:Instance):ContentId
พารามิเตอร์
keyframeSequence:Instance
ส่งค่ากลับ
ContentId
ตัวอย่างโค้ด
KeyframeSequenceProvider:RegisterKeyframeSequence
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local asset = KeyframeSequenceProvider:RegisterKeyframeSequence(workspace.KeyframeSequence)
local animation = Instance.new("Animation")
animation.Name = "การทดสอบการเคลื่อนไหว"
animation.AnimationId = asset
animation.Parent = workspace

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