You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve?
- I have a specific animation for a tool. The tool is only held differently, nothing more and nothing less.
- What is the issue?
- Once the tool is unequipped/deactivated, the animation won’t stop playing. The character is stuck in that position. (Animation is set to Motion)
- What solutions have you tried so far?
- Looked at other topics on the DevForum, and asked different developers in different servers.
Code:
local Tool = script.Parent.Parent
Tool.Equipped:Connect(function()
local Animation = Tool.Animation
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local animator = Humanoid:FindFirstChildOfClass("Animator")
local AnimationTrack = animator:LoadAnimation(Animation)
AnimationTrack:Play()
if Tool.Parent ~= Character then
AnimationTrack:Stop()
end
end)
Output: