單擊時我正在制作帶有影片的工具。但是,當我單擊時沒有任何反應。我嘗試了 2 個腳本,但沒有出現錯誤,但影片無法播放。我擁有影片,其他人說它有效,我不知道為什么它不適合我。這是我的第一個腳本:
script.Parent.Activated:Connect(function()
local action = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.ANIMATE)
action:Play()
end)
這是我的第二個腳本:
local tool = script.Parent
local animation = tool.ANIMATE
tool.Activated:Connect(function()
local character = tool.Parent
local humanoid = character.Humanoid
local AnimationTrack = humanoid:LoadAnimation(animation)
AnimationTrack:Play()
end)
任何幫助表示贊賞!
uj5u.com熱心網友回復:
您應該在 Roblox 開發人員檔案中進行搜索,并且您會發現該Humanoid:LoadAnimation()功能已被棄用。

所以你需要使用Humanoid. Animator: LoadAnimation().
script.Parent.Activated:Connect(function()
local action = script.Parent.Parent.Humanoid.Animator:LoadAnimation(script.Parent.ANIMATE)
action:Play()
end)
tool.Activated:Connect(function()
local character = tool.Parent
local humanoid = character.Humanoid
local AnimationTrack = humanoid.Animator:LoadAnimation(animation)
AnimationTrack:Play()
end)
uj5u.com熱心網友回復:
事實證明,我的影片與我在腳本中忘記的不同游戲所需的影片完全相同。我不知道新的發生了什么,但我終于可以繼續前進了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/472009.html
上一篇:pyqtgrapgh:影像項不在GraphicsView的中心
下一篇:帶間隔的旋轉和淡出
