A Looped Animation Wont Stop

I tried using the line you gave me above, it sadly didn’t work and No there are no errors. this is first time I’ve ever encountered this bug. I held W key and tried running it played run animation just like in video once I got up from the campfire, this is a weird bug It Feels as if the Idle Animation has been replaced by the resting animation.

8 Likes

yeah thats what i was thinking too. maybe try to debug using RestingAnim.Ended:Wait() then print a confirmation message right after to see if it has ended. it could help you gain some more insight into what actually happened to the animationtrack

7 Likes

somewhat like this? Also I checked the Animation Priority and its Movement Loop
image

7 Likes

I checked the Animation Priority and if it was a loop or no. it is Movement in Priority and Looped. Ive also tested the picutre ive shown you above that I sent I also removed the RestingAnim:Stop() Part at first it was stuck it didn’t work, then when I removed that part it did everything except print(“Weird Bug”) and Visible = false part.

5 Likes

I just realised that every time you are checking if the player is resting or not, you load the load the animation regardless. maybe try to use this altered version??

InteractPrompt.Triggered:Connect(function(Player)
	if Player then
		local Character = Player.Character
		local Humanoid = Character:WaitForChild("Humanoid")
		local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
		
		
		
		if Resting == false and Rest_Cooldown == false and not AliveData[Player.Name]:FindFirstChild("Combat") then

            RestingAnim = Humanoid:LoadAnimation(RestingAnimation)
			Resting = true
			Humanoid.AutoRotate = false
			HumanoidRootPart.Anchored = true
			RestingAnim:Play()

		else return end

            InteractPrompt.Triggered:Wait()

			Resting = false
			Humanoid.AutoRotate = true
			HumanoidRootPart.Anchored = false
			RestingAnim:Stop()
			RestingAnim:Destroy()

		end
	end	
end)

im not completely sure this will work tho lol

4 Likes

yeah and if it hasnt ended then you will know

4 Likes

I tried it now, Sadly didn’t work.

3 Likes

dang, hold on let me look at it again.

4 Likes
InteractPrompt.Triggered:Connect(function(Player)
	if Player then
		local Character = Player.Character
		local Humanoid = Character:WaitForChild("Humanoid")
		local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
		
		
		
		if Resting == false and Rest_Cooldown == false and not AliveData[Player.Name]:FindFirstChild("Combat") then

            RestingAnim = Humanoid:LoadAnimation(RestingAnimation)
			Resting = true
			Humanoid.AutoRotate = false
			HumanoidRootPart.Anchored = true
			RestingAnim:Play()

            InteractPrompt.Triggered:Wait()

			Resting = false
			Humanoid.AutoRotate = true
			HumanoidRootPart.Anchored = false
			RestingAnim:Stop()
			RestingAnim:Destroy()
        else return end

	end	
end)

changed it again, try this?

3 Likes

hey um…
not sure if this was intentional but there is no elseif Resting == true then

3 Likes

basically, the InteractPrompt.Triggered:Wait() waits until they press e again which I made sure will only be when they are currently resting because i added else return end. it should theoretically work and yes it was intentional

4 Likes

doesn’t Work sadly
\\\\\\\\\\\\

3 Likes

and no errors in the output with the new code?

3 Likes

still no errors
//////////////

3 Likes

see what this does?
\\\\\\\\\\\\\\\\

3 Likes

also I don’t know if this is intentional but everytime you send me a script, theres always a little error you are forgeting to add local next to restinganim

it prints Signal Ended 2 times

3 Likes

oh I dont add local when its inside of a scope like this, it probably is wrong so you should change it to local. im 99% it runs regardless though

3 Likes

it printed Signal Ended 2 times

3 Likes

try this but also assign the IdleAnimation’s id in the top variable. apologies that I wasnt able to find a solution quickly

3 Likes

maybe youre trying to stop an animation thats already ended? so lets try to overwrite the animation thats on the character right now possibly

3 Likes