straight to the point, I usually use Model:ScaleTo(value) to scale models, how can i scale a model using TweenService? or how can i scale a model smoothly if TweenService isn’t the way to do so?
This is just kind of a rough example I haven’t tested it but it should work, its pretty much just tweening a number value to what you want the new scale to be and theres a listener for when the numbervalue changes it updates the scale to that new size.
You can definitely improve this script but it should help get you in the right direction.
local TweenService = game:GetService("TweenService")
function modelScale(tweeninfo : TweenInfo, model : Model, newsize : number)
local numberValue = Instance.new("NumberValue")
numberValue.Value = model:GetScale()
local tween = TweenService:Create(numberValue, tweeninfo, {Value = newsize})
tween:Play()
numberValue:GetPropertyChangedSignal("Value"):Connect(function()
model:ScaleTo(numberValue.Value)
end)
tween.Completed:Wait()
numberValue:Destroy()
return true
end
2 Likes
i managed to get this to work, thank you!
2 Likes
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.