My game is a tycoon, and when you purchase something in the tycoon, an animation will play that resizes the bought model to be really small, and then quickly resizes it to what it is supposed to be.
This can be better visualized by viewing the below video:
However, a rare but notable bug will occur with this system, resulting in some absurd sizing cases like seen here in this video.
I am wondering what can be done to fix this issue. When an item is bought, it is originally in ServerStorage
, before it is then moved to ReplicatedStorage
for a frame, and then it is moved to the tycoon model in Workspace; this allows for the item to be loaded inside ReplicatedStorage
so a client even can be fired to execute the animation in a local script, as seen below:
local GetScale = obj:GetScale();
local sizeDiff = 10
local i = 0.1;
sound.tycoon.placing:Play()
repeat
i = math.min(i+task.wait()*2,1);
obj:ScaleTo((i^2)*GetScale);
until
i == 1;
I used to use TweenService
instead, but the issue I am describing would happen far more often using it.
How can I make this glitch even more rare, if not outright fix it?