How can I tween the size of a model with two different parts?

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

  1. What do you want to achieve? Keep it simple and clear!

I would like to have the trees tween when they generate on my map for a cool effect. You’ll see that it works with the rocks already.

  1. What is the issue? Include screenshots / videos if possible!

The trees are all two-part models: the trunk and the leaves. I tweened the trunk but can’t figure out how to tween the leaves in relation to it.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    This is my current code which only tweens one part:
tree.base.Size = tree.base.Size/3
game:GetService("TweenService"):Create(tree.base, TweenInfo.new(.8, Enum.EasingStyle.Elastic), {Size = tree.base.Size*3}):Play()

I have tried adjusting the actually model’s scale property but then discovered that it’s not a scriptable property. If anyone has any possible solutions I would appreciate it. Thanks!

You can use a NumberValue to scale the model. For instance, the code below changes that NumberValue’s value within a tween, which then updates the model’s scale.

local tween = game:GetService("TweenService")

local model = script.Parent

local scaleSize = Instance.new("NumberValue")
-- When the NumberValue's value changes.
scaleSize.Changed:Connect(function(size: number)
	model:ScaleTo(size)
end)
-- Tween the model's size (change 2 to the desired size).
tween:Create(scaleSize, TweenInfo.new(.8, Enum.EasingStyle.Elastic), {Value = 2}):Play()