#trying to replay idle after my attack anim plays outside of this remote event

6 messages · Page 1 of 1 (latest)

fiery bramble
#

Did u also try if not target then

snow oracle
#

yes but then it just repeats the animation like 100 times a second so its just having a seizure

fiery bramble
#

Is it a user input script to play the Animation

snow oracle
#
local function setAnimation(object, animationName)
    local humanoid = object:WaitForChild("Humanoid")
    local animationsFolder = object:WaitForChild("Animations")
    
    if humanoid and animationsFolder then
        local animationObject = animationsFolder:WaitForChild(animationName)
        
        if animationObject then
            local animator = humanoid:FindFirstChild("Animator") or Instance.new("Animator",humanoid)
            
            local playingTracks = animator:GetPlayingAnimationTracks()
            for i, track in pairs(playingTracks) do
                
                if track.Name == animationName then
                    return track
                end
            end
            
            local animationTrack = animator:LoadAnimation(animationObject)
            return animationTrack
        end
    end
end
local function playAnimation(object, animationName)
    local animationTrack = setAnimation(object, animationName)

    if animationTrack then
        animationTrack:Play()

    else
        warn("Animation wont play my boi")
        return
    end
end
#

playing the animation with these 2 functions

#

@fiery bramble