roblox tweenservice

local TweenService = game:GetService("TweenService")

local part = script.Parent
local goal = {}
goal.Position = Vector3.new(1, 0, 1)
goal.Color = Color3.new(0, 1, 0) -- Green

local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(part, tweenInfo, goal)
wait(5) -- Wait Time
tween:Play()

3
1
Sahar 90 points

                                    local TweenService = game:GetService("TweenService")
local Part = script.Parent

local info = TweenInfo.new(
	5, 
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local Goals = 
{
	Size = Vector3.new(15,15,15);
}

local MakePartBigger = TweenService:Create(Part, info, Goals)

wait(5)
MakePartBigger:Play()

3 (1 Votes)
0
0
3

                                    local tweenservice = game:GetService("TweenService")

local instance = some_instance

local tween_info = TweenInfo.new(
	1, -- duration
	Enum.EasingStyle.Linear, -- easing style
	Enum.EasingDirection.InOut, -- direction
	0, -- number of repeats
	false, -- reverses when finished
	0 -- delay
)

local goal = {
  intstance_property_1 = "a",
  intstance_property_2 = "b"
}
local tween = TweenService:Create(instance, tween_info, goal)

tween:Play()
-- tween:Pause()
-- tween:Cancel() - stops the tween and resets the values

local tween_ended
tween_ended = tween.Completed:Connect(function()
	-- do something
    tween_ended:Disconnect()
end)

0
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source