Player teleporting when playing 2 or 3 animations at once

Well, this is a “repost” of a little issue I encountered some months ago. Its weird and probably is a bug on Roblox end but for some reason when playing multiple animations at once, changing the weight and speed variables causes the game to teleport you to what I’d guess would be the 128 bit integer limit on the Y axis.

I know how to fix it, “just don’t play many animations at once”. But this is happening for just 2 or 3 overlapping animations which is… very small.

I’ll try debugging and disabling some values whilst waiting for answers, if I find something that might help get a better view of how to solve it I will as soon as possible comment down below

Video showcasing the bug :

1 Like

Since there are no code snippet provided, best i can do is tell you the possible/potential problems,

Most likely it is the animation blending calculation, i suggest you to double check if there’s a mistake in the calculation… also if your code contains any divisions (/) check the values, since if you divide by 0 in Roblox… it’ll return infinite, which i accidentally stumbled upon A LOT of times (dementia moment) :sob:

1 Like

That gave me an idea, I’ll try to see if I can replicate the bug by setting either the weights to 1/0 or the speed to 1/0. I’ll come back with the results


Here’s the animation I will be trying out for now, just a quick example, nothing to special.

I’ll play the animation with this script

local Animation = script.Parent:WaitForChild("Humanoid"):LoadAnimation(script.Animation)

Animation:Play()

task.wait(2)

Animation:AdjustWeight(1/0)

And this is the result

Hm, well it doesn’t seem to work. I tried for AdjustSpeed but the only thing that happened was that the animation looked like it stoped completely

I did it! I replicated the bug.

Using this code I replicated the bug

local Animation = script.Parent:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("Animation"))

Animation:Play()

task.wait(2)

game:GetService("RunService").RenderStepped:Connect(function()
	Animation:AdjustWeight(0,.1)
end)

it was the blending calculations, just not my blending calculations!

Now when we know this how would we be able to fix it :face_with_monocle:?

Well that was fast! My suspicion to the issue is that Roblox themselves coded the problem, somewhere in the code I suspect there might be a division taking place. A division by zero. When I was bug testing the glitch happened when the weight was extremely small. Thanks for the help @Herstal_PinkP90 ! I really appreciate it :wink:

Hope you have a nice day

edit: for anyone wondering how I fixed it here’s how

Code
local Animation = script.Parent:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("Animation"))

Animation:Play()

game:GetService("RunService").RenderStepped:Connect(function()
	if Animation.WeightCurrent > .01 then
		Animation:AdjustWeight(0)
	end
end)
1 Like