Model Tween - Not working?

I’m editing a version of a Model Tweener; below is what I have so far - The scaling upwards works fine - But when reducing the size - Literally nothing happens.

Can anybody suggest any work around or fixes?
Thank you!

Noting below, ‘ScaleType’ [1] is Increase and else is the decrease.

TweenModelSize(i["Model"], 200, "1", .25, Enum.EasingStyle.Linear, Enum.EasingDirection.In)

TweenModelSize = function(Target, Inc, ScaleType, Duration, EasingStyle, EasingDirection)
	--spawn(function()
		local s = Inc - 1
		local i = 0
		local oldAlpha = 0
		while i < 1 do
			local dt = RunService.Heartbeat:Wait()
			i = math.min(i + dt/Duration, 1)
			local alpha = TweenService:GetValue(i, EasingStyle, EasingDirection)
			if ScaleType == "1" then
				RescaleModel(Target, ScaleType, (alpha*s + 1)/(oldAlpha*s + 1))
			else
				RescaleModel(Target, ScaleType, (alpha/s - 1)*(oldAlpha/s - 1))
			end
			oldAlpha = alpha
		end
	--end)
end

RescaleModel = function(Target, ScaleType, a)
	--spawn(function()
		local Base = Target.PrimaryPart.Position
		for _, part in pairs(Target:GetDescendants()) do
			if part:IsA("BasePart") then
				part.Position = Base:Lerp(part.Position, a)
				if ScaleType == "1" then
					part.Size *= a
				else
					part.Size /= a
				end
			end
		end
	--end)
end
1 Like

If you print out the value of a what do you get?

Define which value it is I’m looking for?

The increasing of the model Size works fine, however the decreasing is where the issues are at.

If a is positive in grows and if negative it shrinks?

Yeah,
I’ve also labeled an argument as ScaleType to seperate the two.
ScaleType == 1 is the increase in scale,
else is the decrease.

In the second segment you can see how I adjusted the *= to a /= also.

so you should see the part.Size grow or shrink. Does it?

It grows yes, it doesn’t shrink.

Ok, so, Size is a Vector3 so maybe * does work and / does not.
Try doing the / using the contents as in
part.Size = Vector3.new(part.Size.X/a,part.Size.Y/a,part.Size.Z/a)