Animation broken by subsequent code

My animation seems to break if I write anything after it, even a wait function, only print didn’t cause it

local function onStateChanged(_oldState, newState)
	if newState == Enum.HumanoidStateType.Landed and _G.isPounding then
		canPound = false
		Lv:Destroy()
		PTrack:Play(0)
	end
local function onStateChanged(_oldState, newState)
	if newState == Enum.HumanoidStateType.Landed and _G.isPounding then
		canPound = false
		Lv:Destroy()
		PTrack:Play(0)
		Humanoid.WalkSpeed = 0
		PTrack.Stopped:Wait()
		Humanoid.WalkSpeed = 16
	end

When animation dont play as intended its usually due to animation blending, weight, priority.

Here are my three ideas:

  1. You can do :GetPlayingAnimationTracks() to debug the difference and see if anything changes or are there any unintended animations blending in.

  2. Try this below to see if its an animation weight and blending problem:

  1. Or you can try setting the weight to very high for this animation.
1 Like

Yeah, it seems to have been an issue with another animation, as stopping all animations before executing this one fixed the issue.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.