Help on letting the brick have a touched function while being animated with a RIG

Currently attempting to have my Rig play its animation. At the timing of the hammer hitting the anvil, I want my particles to show AT THAT EXACT TIME. Due to the fact, I don’t think my script coding can be active during the animation because it’s welded with the dummy while it’s being animated.

How would I want my hammer have a script that can determine when the hammer hits the exact moment it touches the anvil?
https://gyazo.com/befd7444d83c63ddb2753d76cb680d9d

I think it will be easiest to use this AnimationTrack | Documentation - Roblox Creator Hub
But I’ve never tried animating, so I don’t know how to insert them into an animation.

Hi, Since you’re using Moon Animation, the name of what you’re looking for is quite different, but yes, it’s the same behavior as KeyFrame

image

On the timeline, you have to Add a Label, the Slider is the Timeline’s top
image

To make any change to the created Label, double click on it image

Rename your label to whatever action the character is doing at this moment
image

Then, as tlr22 linked, this is the way you can detect what Label(Keyframe) has been passed while the animation was played

local animTrack = humanoid:LoadAnimation(anim)
animTrack:GetKeyframeReachedSignal("HammerHit"):Connect(function(value)
print(value)
end)

Hope this helps

2 Likes

Thank you so much, this was a helpful comment.