I want my animation to not repeat after it plays.
I made a new animation that basically simulates punching, but when I play it, it keeps repeating and doesn’t stop.
This confuses me because other animations I play don’t repeat and I’m using the same script for both of them.
Here is the test code I wrote to simulate the animation. Below it is a picture for better reference
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Animations = ReplicatedStorage:WaitForChild("Animations")
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local anim = Animations:WaitForChild("M1")
local animTask = animator:LoadAnimation(anim)
while wait(3) do
animTask:Play()
end
I have a picture of 2 rigs, the right is repeating and the left isn’t repeating, while they both use the same script.