Animation cubic easing direction reversed

Just trying to practice some animation and came across this issue. For now, my temporary solution is to make a copy of all the KeyframeSequences then place them somewhere safe, then run this code via command bar (best to edit this through script first to change variable “Sequence”):

local Sequence = workspace.thing1.thing2.sequence
-- Set Sequence to path of KeyframeSequence
for _, K in pairs(Sequence:GetChildren()) do
	local Poses = K:GetDescendants()
	for _, P in pairs(Poses) do
		if P.EasingStyle == Enum.PoseEasingStyle.Cubic then
			if P.EasingDirection == Enum.PoseEasingDirection.In then
				P.EasingDirection = Enum.PoseEasingDirection.Out
			elseif P.EasingDirection == Enum.PoseEasingDirection.Out then
				P.EasingDirection = Enum.PoseEasingDirection.In
			end
		end
	end
end

It looks for all Pose instances inside the sequence, and if a Pose object’s EasingStyle is set to Cubic, it will invert In to Out and vice versa. It will ignore the Pose if it is set to InOut instead.

I would keep the original animation before I run this so that I don’t have to rerun code after an official fix is released.

Edit 1-2: I also noticed the Cubic value actually works correctly more than it fails at least for Play mode, not Solo Mode.

Edit 3: Nevermind, both Play and Solo Modes fail to play Cubic animations. Apparently, though, my first tests show that Play Mode is 70% fine, then after testing it again, it fails completely. Perhaps after pressing Solo Mode, it also brings down Play Mode with it.

3 Likes

Hi this is still an ongoing issue

10 Likes

Basically, what you have to do is reverse the direction of all cubic keyframes. So if it’s easing in, change it to easing out. If it’s easing out, change it to easing in. It will look super wonky, but it will play how you intended it in game. Now I see why people prefer moon animator, as cubic keyframes are my most used.

1 Like

I’ve run into this problem as well. This is still a thing as of now.

3 Likes

This issue is still not fixed? Seriously?

7 Likes

Twenty days later here. Still not fixed. I understand if this is hard or something, but this is really ruining my animations!

3 Likes

At this point, someone should just make a plugin that automatically swaps cubic in and cubic out keyframes. On Roblox’s side, it is very frustrating that this still hasn’t been fixed for over a year, when to fix all this is to literally just rename the easing styles to their proper function.

3 Likes

Moon Animation Editor is also reversed but the output didn’t show it as the wrong way

I’d go for Blender because why not

1 Like

this happened to me today. good lord

1 Like

This is still an issue! It is very frustrating that I can’t preview my animations exactly as they’ll appear when played back in a real animation!

3 Likes

Hello, information on why this is happening:
Roblox’s animation editor relies on a EasingStyles module, whose source is:

local module = {}

--Ignore semicolons. Converted from C++

module.GetEasing = function(style, direction, percent)
	if style == "Bounce" then
		if direction == "Out" then
			return 1 - easeOut(percent, bounce)
		elseif direction == "In" then
			return 1 - bounce(percent)
		else
			return 1 - easeInOut(percent, bounce)
		end
	elseif style == "Elastic" then
		if direction == "Out" then
			local totalTime = 1
			local p = totalTime * 0.3;
			local t = 1 - percent;
			local s = p / 4;
			return (1 + 2 ^ (-10 * t) * math.sin((t * totalTime - s) * (math.pi * 2)/  p));
		elseif direction == "In" then
			local totalTime = 1
			local p = totalTime * 0.3;
			local t = percent;
			local s = p / 4;
			return 1 - (1 + 2 ^ (-10 * t) * math.sin((t * totalTime - s) * (math.pi * 2) / p));
		elseif direction == "InOut" then
			local t = percent *2;
			local p = (.3*1.5);
			local s = p/4;
			if t < 1 then
				t = t - 1;
				return 1 - (-0.5 * 2 ^ (10 * t) * math.sin((t - s) * (math.pi * 2) / p));
			else
				t = t - 1;
				return 1 - (1 + 0.5 * 2 ^ (-10 * t) * math.sin((t - s) * (math.pi * 2) / p));
			end
		end
	elseif style == "Cubic" then
		if direction == "Out" then
			return 1 - easeOut(percent, cubic)
		elseif direction == "In" then
			return 1 - cubic(percent)
		elseif direction == "InOut" then
			return 1 - easeInOut(percent, cubic)
		end
	elseif style == "Linear" then
		return 1 - percent
	elseif style == "Constant" then
		if style == "Out" then
			return 1
		elseif style == "In" then
			return 0
		elseif style == "InOut" then
			return 0.5
		end
	end
end

function easeIn(t,func)
	return func(t)
end

function easeOut(t,func)
	return 1 - func(1 - t)
end

function easeInOut(t,func)
	t = t * 2
	if t < 1 then
		return easeIn(t, func) * 0.5
	else
		return 0.5 + easeOut(t - 1, func) * 0.5
	end
end

function bounce(t)
	if t < 0.36363636 then
		return 7.5625 * t * t
	elseif t < 0.72727272 then
		t = t - 0.54545454
		return 7.5625 * t * t + 0.75
	elseif t < 0.90909090 then
		t = t - 0.81818181
		return 7.5625 * t * t + 0.9375
	else
		t = t - 0.95454545
		return 7.5625 * t * t + 0.984375
	end
end

function cubic(t)
	return t ^ 3
end

return module

If you use this module and run

local A1 = EasingStyles.GetEasing('Cubic', 'In', 0.5)
local A2 = TweenService:GetValue(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out)
print(A1 == A2)

the result will print true.
This means that the problem here is the EasingStyles module they use has problems. I’ve also noticed how in general, the module is inconsistent with Roblox’s TweenService:GetValue almost always.

For example,

local A1 = EasingStyles.GetEasing('Elastic', 'In', 0.5)
local A2 = TweenService:GetValue(0.5, Enum.EasingStyle.Elastic, Enum.EasingDirection.In)
print(A1, A2)

the EasingStyles module will print -0.015625, whilst :GetValue will print -0.022097086533904. This in itself shows that there’s an issue in one of the modules, and I assume it’s EasingStyles.

An easy solution would be to just switch to TweenService:GetValue, which would not only fix these issues, but make the results consistent with TweenService and also give support for more tween styles.

The reason I even know about this is because I spent weeks ripping my hair out, figuring out why my module, which calculated the CFrames a limb would be in during a specific time, was inconsistent with the actual animation.

@Hippie_ofDoom please look into this!

14 Likes

Update… Still broken


This video shows the worst case scenario. (Pardon the lag, laptop doesn’t like recording while the game is running)

Project file: animationbug.rbxl (29.8 KB)

7 Likes

Same issue with my FPS model, but it seems like InOut is being exported as “In*” rather than, well, InOut.

Video:

(Just in case, let me know if I should post this somewhere else, please. Thanks.)

EDIT: The exported cubic InOut seems to be using the “old version(?)” rather than the new one shown in the Animation Editor.

3 Likes

Just realised that it’s been a whole year since the report and it hasn’t been fixed up yet. All of the directions for cubics are just reversed. In, Out and InOut

Ironically, using the old Animator Plugin that buildthomas published (The Legacy one) seems to display the animation position correctly.

Roblox’s animator plugin.

Legacy one.

6 Likes

It seems to be a personal frustration for me and many others that this bug is still yet to be resolved. Roblox needs to step up their game here: Many animators rely on the official Roblox Animation plugin to create their animations due to the presence of its simplicity and efficiency.

All of us here would be looking forward for any response on this specific issue. It is ridiculous that this has been prolonged for so long.

5 Likes

Can verify this has been an issue for a good while.

A simple, if not hacky fix, would just be having the animation editor invert the easing for cubic keyframes, at least until the root of the problem can be found.

2 Likes

It seems they updated the Animation Editor. Can you guess what they have not fixed and aren’t planning to fix over the span of 4 or more weeks?

2 Likes

I know what you’re talking about by finding out the hard way.

It’s by uploading a animation with cubic tweens and comparing the export and Animation Editor.

1 Like

This is likely related to the choppiness of “Cubic” on InOut, too, which has been occurring the past year. It really makes easing styles completely useless, which is a shame because they made a big deal out of it when it first came out. If they could fix this along with adding a few more easing styles like the Moon Animator has, it would make animating a whole lot easier.

1 Like

Update, it still is broken plus inverting the easing style does not actually fix anything. When i invert the easing style in the animation editor, the resulting animation that plays in the client is still not as smooth as it was in the animator before flipping the easing style. It’s not great to know that i cant rely at all on the roblox animation editor anymore and instead have to export from other applications.

1 Like