Trying To Script Two Idle Animations

Hello Everyone!
I’ve been trying to script two idle animations for example
I spawn in and my first idle animation plays
Until I press G then my second idle animation plays,but then after it’s done it just switches over the the fist idle animation

Basically I want the second idle animation to play until I press a key that switches the animations

My first animation


my second animation

You may have to destroy the other animation like this

if IsTyping then return end
if Imput.KeyCode == Enum.KeyCode [Key]  then
local IdleAniTrack=Human:LoadAnimation(IdleAni)
IdleAniTrack:Play()
Human:LoadAnimation(Animation):Destroy()

I hope that script works.

1 Like

I dont understand why you have 2 local scripts

-- load first track
Track1:Play()

UIS.InputBegan:Connect(function(Input)
    -- if keycode blah blah
    Track1:Stop(); Track2:Play()
end)
1 Like