Hello. You see the title. I have a custom animation with UserInputService.
But when I play the animation, RunAnimation brokes it then a mix of run and custom animation happens.
I know something is wrong in my script, I’m new to Animations. Also, I tried with :AnimationPlayed() but couldn’t work.
Here, my code:
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if input.UserInputType == Enum.UserInputType.MouseButton3 then
local AnimationTracks = hum:GetPlayingAnimationTracks()
for i, track in pairs (AnimationTracks) do
if track.Name == "RunAnim" then
track:Stop()
print("Run stopped")
end
end
customTrack:Play()
debounce = false
wait(1)
debounce = true
end
end)