如何在Roblox动画中的某个点发生某些事情

问题描述 投票:0回答:1

我在迷惑Roblox Studio,无法弄清楚如何使其在动画中的某个点打印“测试”。这是代码:

animationTrackTwo:GetKeyframeReachedSignal("Throw"):Connect(function(value)
    print("test")
end)

local animationTrackTwo = character.Humanoid:LoadAnimation(script.Parent.ThrowSnowball)
animationTrackTwo:Play()

[我想我在称为'Throw'的动画中插入了关键帧(我可能做错了,但是它说GetKeyframeReachedSignal不是animationTrack的有效成员。有人知道我在做错什么吗?

lua roblox
1个回答
0
投票

尝试使用:GetMarkerReachedSignal()函数,有关更多信息,请参见:https://developer.roblox.com/en-us/api-reference/function/AnimationTrack/GetMarkerReachedSignal

© www.soinside.com 2019 - 2024. All rights reserved.