How can i get and stop the NPC’s animation when it touched a certain part (bear Trap)?
local animation = animationInstance
local humanoidLoad = workspace.Rig.Humanoid.Animator:LoadAnimation(animation)
humanoidLoad:Stop()
It’s worked in serverside or clientside but animation will return normally when animation just played again
for _,v in pairs(Humanoid:GetPlayingAnimationTracks())do
v:Stop()
end
I mean i’m stopping the animation where the script are not parented to the NPC but to the part that it touched/stepped
example touched
Script.Parent.Touched:Connect(function(Hit)
if Hit.Parent and Hit.Parent:FindFirstChild('Humanoid') then
for _,v in pairs(Hit.Parent.Humanoid:GetPlayingAnimationTracks())do
v:Stop()
end
end
end)
It work, thank you so much my friend
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.