Tweening in only positive

Hello. I am trying to tween a part’s size, but when it tweens, it tweens in the - direction and the +. I only want it to go +. Is this even possible? I think it has to do with CFrame

Here is the code. I just want to know what to change. Thank you

local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(3.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local part = game.Workspace.Part
local goal = {Size = Vector3.new(10, 0.25, 0.25)}
local tween = tweenService:Create(part, tweenInfo, goal)

tween:Play()

edit: here is a picture of what is happening

Hi. I don’t understand what you mean. Are you trying to make the tween move indefinitely, unlike how it usually is set to a destination ahead of time?

Edit: Sorry, I think I understand now. It’s because it increases the part’s size from both sides, right? The only way I’ve gotten around that is by setting the part’s position along with the size. So add +1/2 of the part’s growth amount?

But then it still grows out the other side, not what i want

For example, you have a part that is (5, 1, 1). The goal is for the size to be (10, 1, 1). Position += Vector3.new(part.size.x / 2, 0, 0). Sorry, I don’t know any other way of doing this other than compensating for the half change in position

1 Like

bump

30 minimum

Do you mean as In the Positive Axis?

yeah, I didnt know what to call it

I’m pretty sure you can Tween it so it goes backwards like for Example:

  • Change the Size Values

  • Subtract the Position based on that Size value

Just an Idea, I’m currently rushing to do stuff so I can’t look into this thoroughly .

I am sorry, what do you mean by that?

BasePart.Position - Vector3.new(Size, Size, Size) -- based on that

I figured out what you meant, I could not get it to work. I think this is a bug

Is this what you’re trying to achieve?

local NewSize = Vector3.new(10, 0.25, 0.25)

local tweenService = game:GetService(“TweenService”)
local tweenInfo = TweenInfo.new(3.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local part = game.Workspace.Part
local goal = {
Size = NewSize,
CFrame = part.CFrame + Vector3.new((part.Size.X/-2)+(NewSize.X/2),0,0)
}
local tween = tweenService:Create(part, tweenInfo, goal)

tween:Play()

RobloxStudioBeta_ONjqwy88Sv

I’m using the block’s Size.X property and the new size’s X value to maintain the initial position of one of the face’s starting positions.

1 Like

I already figured it out, but thanks for the reply. I should have marked as solved. Sorry

PS: This is exactly what I did

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.