EasingStyles 8, 9 and 10 not working with TweenPosition

Reproduction Steps

  1. Create an ImageLabel and name it “Img”
  2. Run this on a LocalScript:
local Players 	= game.Players
local Player 	= Players.LocalPlayer
local PlayerGui = Player.PlayerGui
local Gui 		= PlayerGui:WaitForChild("ScreenGui")
local Img 		= Gui.Img
local START_POSITION = UDim2.new(0, 0, 0, 0)
local GOAL_POSITION = UDim2.new(1, 0, 1, 0)

Img.Position = START_POSITION
Img:TweenPosition(
	GOAL_POSITION,           -- Final position the tween should reach
	Enum.EasingDirection.In, -- Direction of the easing
	Enum.EasingStyle.Exponential,   -- Kind of easing to apply
	5                       -- Duration of the tween in seconds
)
  1. Test changing Enum.EasingStyle also to Circular (9) and Cubic (10)

Expected Behavior
The tween animation should work

Actual Behavior
The tween animation only works for Enum.EasingStyle from 0 to 7.

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly

6 Likes

Try using game.Tweenservice and TweenInfo.new(), despite the fact that tweenservice is commonly used on parts, it can be used on UIs as well. so try something like this

local Img = game.Players.LocalPlayer.PlayerGui.Gui.Img
Img.Position = UDim2.new(0,0,0,0)
local tweenInfo = TweenInfo.new(
5,
Enum.EasingStyle.Exponential,
Enum.EasingDirection.In
)
game.TweenService:Create(Img,tweenInfo,{Position = UDim2(1,0,1,0)}):Play()

I know.
But the topic is about GuiObject | Roblox Creator Documentation.

Those tweening styles are currently limited to internal use, I’m not sure why but it’s been that way for years.

No, they will work with Tweenservice.

There was a bug report for this issue before, and they likely won’t be fixed. You’re supposed to use TweenService instead of TweenPosition and TweenSize, which works with these EasingStyles.

5 Likes