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
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
do you want to tween the size in 1 direction?
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
That is what I am using right now.
Yes, but it doesn’t tween in one direction.
Can you please provide more of the code so we can see how you’re using it?
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
That script seems to be working for me. Can you say exactly what the problem is?
in what axis do you want to keep the same direction?
do you want it to go down or what?
I want to increase the Y axis.
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---------------- →