Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a part tween with different In and Out animations?

Is it possible to make a part tween with a different In and Out animation?

Like for example like the part will have a 'Bounce Out' animation then a 'Sine In' animation

This is the original code for the tween

local TweeningService = game:GetService("TweenService")
local partChanges = {
	Position = Vector3.new(-40, 59.25, 0)
}
local TweenInformation = TweenInfo.new(
	1, -- Tween length
	Enum.EasingStyle.Bounce, -- Easing Style
	Enum.EasingDirection.Out, -- Easing Direction
	3, -- Repitition time
	true, -- Reverse?
	3 -- delay		
)
local tween = TweeningService:Create(game.Workspace.Crush,TweenInformation,partChanges)
wait(1)
tween:Play()

I tried this... But, it stills has the Bounce animation for both In and Out Directions

local TweeningService = game:GetService("TweenService")
local partChanges = {
	Position = Vector3.new(-40, 59.25, 0)
}
local TweenInformation = TweenInfo.new(
	1, -- Tween length
	Enum.EasingStyle.Bounce, -- Easing Style
	Enum.EasingDirection.Out, -- Easing Direction
	3, -- Repitition time
	true, -- Reverse?
	3, -- delay		
	
	1, -- Tween length
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.In,
	3, 
	true,
	2	
)
local tween = TweeningService:Create(game.Workspace.Crush,TweenInformation,partChanges)
wait(1)
tween:Play()

1 answer

You're not supposed to put In and Out in a single TweenInfo.

In:

local TweeningService = game:GetService("TweenService")
local partChanges = {
    Position = Vector3.new(-40, 59.25, 0)
}
local TweenInformation = TweenInfo.new(
    1, -- Tween length
    Enum.EasingStyle.Bounce, -- Easing Style
    Enum.EasingDirection.Out, -- Easing Direction
    3, -- Repitition time
    true, -- Reverse?
    3 -- delay      
)
local tween = TweeningService:Create(game.Workspace.Crush,TweenInformation,partChanges)
wait(1)
tween:Play()

Out:

local TweeningService = game:GetService("TweenService")
local partChanges = {
    Position = Vector3.new(-40, 59.25, 0)
}
local TweenInformation = TweenInfo.new(
    1, -- Tween length
    Enum.EasingStyle.Sine, -- Easing Style
    Enum.EasingDirection.In, -- Easing Direction
    3, -- Repitition time
    true, -- Reverse?
    2 -- delay      
)
local tween = TweeningService:Create(game.Workspace.Crush,TweenInformation,partChanges)
wait(1)
tween:Play()

Combined:

local TweeningService = game:GetService("TweenService")
local partChanges = {
    Position = Vector3.new(-40, 59.25, 0)
}
local TweenInformation = TweenInfo.new(
    1, -- Tween length
    Enum.EasingStyle.Bounce, -- Easing Style
    Enum.EasingDirection.Out, -- Easing Direction
    3, -- Repitition time
    true, -- Reverse?
    3 -- delay      
)
local tween = TweeningService:Create(game.Workspace.Crush,TweenInformation,partChanges)
wait(1)
tween:Play()

TweenInformation = TweenInfo.new(
    1, -- Tween length
    Enum.EasingStyle.Sine, -- Easing Style
    Enum.EasingDirection.In, -- Easing Direction
    3, -- Repitition time
    true, -- Reverse?
    2 -- delay      
)
tween = TweeningService:Create(game.Workspace.Crush,TweenInformation,partChanges)
wait(1)
tween:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.