Part resize while keeping aspect ratio

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to resize a meshpart while keeping it’s original position in a tween.

  2. What is the issue? Include screenshots / videos if possible!
    The issue is, the resize occurs from the center of the meshpart. I need it to resize from the bottom of the part towards the top, but it’s not a y axis only change.
    Example: Starting size = 0, 0, 0, end size = 8, 30, 4

  3. What solutions have you tried so far?
    I looked at a bunch of posts in the developer fourm and found a formula for resizing 1 axis and tried to adapt to all size change: primaryModel.CFrame * CFrame.new((actualModelSize.X - primaryModel.Size.X)/2, (actualModelSize.Y - primaryModel.Size.Y)/2, (actualModelSize.Z - primaryModel.Size.Z)/2)
    But this doesn’t work

local sizeTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) 
local sizeTween = TweenService:Create(primaryModel, sizeTweenInfo, {Size = actualModelSize, CFrame = primaryModel.CFrame * CFrame.new((actualModelSize.X - primaryModel.Size.X)/2, (actualModelSize.Y - primaryModel.Size.Y)/2, (actualModelSize.Z - primaryModel.Size.Z)/2)})
sizeTween:Play()

So i made this script that could help you out with your problem also i would use a MeshPart for any mesh you have.

--This goes inside of the Workspace
local tweenService = game:GetService("TweenService")
local part = game.Workspace.MeshPart--Your parts name 

local tweenInfo = TweenInfo.new(
	1.5,--How long it takes to complete
	Enum.EasingStyle.Linear,--Easing style
	Enum.EasingDirection.Out,--EasingDirection
	1,--Repeat count use -1 to repeat forver
	false,--Reversed?
	2--Delay before starting
)


local properties = {
	["Size"] = Vector3.new(8, 8, 8)--How big it will get after the tween plays
}

local tween = tweenService:Create(part, tweenInfo, properties)

tween:Play()

Thanks for the reply!

I did fix it right after making it though. :smiley:

1 Like

Glad you managed to fix it good luck with your project! :smiley:

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