New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

How to Tween a Part's Size in a Single Direction?

Asked by
StoicDev 186
6 months ago

I am looking to tween a part's size in a single direction. Currently, when I tween the part's size, it tweens evenly from both sides.

How could I get it to shrink to the desired size by only shrinking from a single side?

1 answer

Log in to vote
Answered by
p0etic 5039 Moderation Voter Community Moderator
6 months ago
Edited 6 months ago

You can tween both the size and position to give the illusion that it's tweening to one size instead of both.

The following script will resize a part to 20 studs long left/right depending if the part size is bigger or smaller than 20 without resizing the other size.

TweenService = game:GetService("TweenService")

part = script.Parent
newSize = 20

endSize =, part.Size.Y, newSize)
endPosition = part.Position +,0, (part.Size.Z/2) - (newSize/2))

goal = {
    Size = endSize,
    Position = endPosition

timeInSeconds = 3

tweenInfo =
tween = TweenService:Create(part, tweenInfo, goal)

Perfect! Thanks StoicDev 186 — 6mo

Answer this question