How to tween part in one direction

I need help trying to tween a part in one direction.

This is what I got right now:

local tweenPartSize = {
	Size = Vector3.new(1, 5, 1),
	Position = Vector3.new(part.Position.X, part.Position.Y * 2, part.Position.Z)
}

-- stuff
1 Like

do you want to tween the size in 1 direction?

3 Likes

I’d recommend looking into TweenService.

2 Likes

Hello, using tween service, you’re able to do so.

local TS = game:GetService("TweenService")

local tweenInfo = TweenInfo.new(1) -- time, easingStyle, easingDirection goes here

local tweenPartSize = { --this is basically your goal
	Size = Vector3.new(1, 5, 1),
	Position = Vector3.new(part.Position.X, part.Position.Y * 2, part.Position.Z)
}

local tween = TS:Create(part, tweenInfo, tweenPartSize)

tween:Play() -- Puts the tween into effect
3 Likes

That is what I am using right now.

3 Likes

Yes, but it doesn’t tween in one direction.

2 Likes

Can you please provide more of the code so we can see how you’re using it?

2 Likes
local tweenPartSize = {
	Size = Vector3.new(1, 5, 1),
	Position = Vector3.new(part.Position.X, part.Position.Y * 2, part.Position.Z)
}

local function tweenSize(speed)
	local tweenInfo = TweenInfo.new(speed, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
	local tween = TweenService:Create(part, tweenInfo, tweenPartSize)
	tween:Play()
end
2 Likes

That script seems to be working for me. Can you say exactly what the problem is?

2 Likes

in what axis do you want to keep the same direction?

2 Likes

2 Likes

do you want it to go down or what?

1 Like

I want to increase the Y axis.

1 Like

That’s what it’s doing, is it not? Do you not want it to scale the size?

Yes but I don’t want the part to rise up.

what do you exactly mean? if the Y axis is increased it will rise up more.
do you want to keep the same size but change its position in the Y axis?

I’m confused. You mean you want to increase the scale, but not the height?

local tweenPartSize = {
	Size = Vector3.new(1, 5, 1),
	Position = Vector3.new(part.Position.X, part.Position.Y - 2.5, part.Position.Z)
}

Is this what you want?

It works but it kind of tweens it down.

if you want to keep it still then just keep the size in it

local tweenPartSize = {
	Size = Vector3.new(1, 5, 1),
}

local function tweenSize(speed)
	local tweenInfo = TweenInfo.new(speed, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
	local tween = TweenService:Create(part, tweenInfo, tweenPartSize)
	tween:Play()
end

I’m trying to do this:

o---------------- →