如何让某事在 Roblox 动画中的某个时刻发生

How to Make Something Happen at a certain point in a Roblox Animation

我正在使用 Roblox Studio,但不知道如何让它在动画中的特定点打印 'test'。这是代码:

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

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

我想我在名为“Throw”的动画中插入了一个关键帧(我可能做错了)但它说 GetKeyframeReachedSignal 不是 animationTrack 的有效成员。任何人都知道我做错了什么?

尝试使用 :GetMarkerReachedSignal() 函数,更多信息可在以下位置找到:https://developer.roblox.com/en-us/api-reference/function/AnimationTrack/GetMarkerReachedSignal