I have a code which upon pressing G, a model will play an animation and stops at the last keyframe ( pose). Pressing G again should resume the track but it doesn't. track.speed returns 1 but the model is stuck at the pose.

if keyPressed == Enum.KeyCode.G then
	posing = not posing;
	local animation = game.ReplicatedStorage.Poses.point;
	local character = playerLocal.Character or playerLocal.CharacterAdded:wait();
	local stand = character.Stand;
	local track = stand.Humanoid:LoadAnimation(animation);
	if posing then
		track:Play();
		track.KeyframeReached:Connect(function(name)
			if name == 'pose' then
				track:AdjustSpeed(0);
			end
		end)
	end
	if not posing then
		track:AdjustSpeed(1);
		print(track.Speed)
	end
end

How do I go about fixing this?

2 comments

0

the animation track while adjusted to 0 plays very slowly, could be the chance that the animation has ended?

0

not the case, i upped the duration to 1 second and it would still be stuck after adjusting the speed. thanks for helping thou