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