I’m looking for a way to Tween a model downwards / into the floor as opposed to it’s center?
As you can see from the image I’ve got the Model to resize accordingly - However, it only does so from the center.
This is the desired effect:
Thank you!
I’m looking for a way to Tween a model downwards / into the floor as opposed to it’s center?
As you can see from the image I’ve got the Model to resize accordingly - However, it only does so from the center.
This is the desired effect:
Thank you!
While it’s sizing down cframe it downwards as well by a specific amount. Adjust it accordingly enough and it will look as if it’s on the surface while shrinking.
example: https://gyazo.com/0a8e3bb18c7abd0b5463329205cbb8d7
The most preferable amount you’d want to move it down by is normally half the rate of which you’re expanding/contracting.
example of the code in the gif above:
while task.wait() do
script.Parent.Size -= Vector3.new(.1,.1,.1)
script.Parent.CFrame -= Vector3.new(0,.05,0)
end
Brilliant, thank you!
Just to add - in terms of doing this with a Model:
If you get the Size of the Model before / after the adjustment then work out the difference and / 2 then you get the same effect.
Num:GetPropertyChangedSignal('Value'):Connect(function(...)
PrevCF, PrevSize = Model:GetBoundingBox()
Model:ScaleTo(Num.Value)
CF, Size = Model:GetBoundingBox()
Model:PivotTo(Model:GetPivot() - Vector3.new(0, (PrevSize.Y - Size.Y) / 2, 0))
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.