Animation Track Limit of 256 tracks for one animator exceeded

I’m currently working on a train game that requires trains to be moved smoothly and synced between clients.

My current method is that the server sends all clients info about a train movement, then each client uses tween service to move the train. Below is the function I use to tween a model to a certain position.

function TWEENMODEL(model, cframe, pause, style)
	local CFrameValue = Instance.new("CFrameValue")
	CFrameValue.Value = model:GetPrimaryPartCFrame()
	CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
		if model ~= nil then
			if model.PrimaryPart ~= nil then
				model:SetPrimaryPartCFrame(CFrameValue.Value)
			end
		end
    end)

	local tween = game:GetService("TweenService"):Create(CFrameValue, TweenInfo.new(pause, style), {Value = cframe})
	tween:Play()
	return tween
end

This has worked well for this game and many previous. However, in recent tests I have occasionally been getting the following message in the server output

(‘MT’ is printed server-side whenever a train movement event is sent to the clients. I am not sure if it is linked to the issue)

This message is very confusing as my game does not use any animations / humanoid animations of any kind.

I can only think of two causes for this:

  1. Tween service is possibly connected to animations and therefore I am accidentally playing 256+ tweens on the same model (I tried to reproduce this but did not get the error) The issue seems to happen when i’m in game for a long amount of time. Maybe once 256+ train movements have happened?

  2. It’s something to do with my player model and an issue on Roblox’s end.

I’m finding it incredibly hard to reproduce and it’s especially weird as this is in the server output, when all tweening is done locally.

Any advice would be appreciated.


EDIT

I had the idea of disabling all trains and waiting until all tweens have stopped. The message is stiill being printed twice in chat every two seconds. Nowhere server-side in my game do I have any loops with a 2 second delay. Also for extra info, I had 4 trains running in the game at the time, so the message printing twice does not make sense either.


EDIT #2

I just found this lad on my map used for scaling, who I completely forgot about. It has an animation script inside and would make sense to be causing this problem. I’ll remove it, do some more tests and see if the problem persists.

4 Likes

Well… this was a very short investigation.

Turns out the culprit was in fact the random free model zombie model I was using with the following script inside. Nothing to do with tween service at all. And there’s the 2 second delay I was looking for :man_facepalming:

10 Likes

Your safest bet is to make your own little model or do what I do and insert one of the default animation rigs from the built-in animation editor.

Makes it super quick to just insert a new Robloxian 2.0 rig without the toolbox and contains no strange character scripts.

2 Likes

Hello! I also have this exact same problem also from the drooling zombie. How do I fix it?

1 Like

Like which script and which part of the script and how do i change it?

1 Like

Put the animationtrack variable outside of the while loop

2 Likes