So I was using a while true do loop to rotate “handles” for a shop inventory. Of course this means that all the handles are rotated simultaneously, as I can’t seem to find a way to rotate a specific handle if that viewport frame for the handle was open. Anyways I have a large amount of handles, and a simple loop had resulted in this error.
script timeout: exhaustion allowed execution time
When I opened up the shop, studio literally froze for around 10 seconds. Why is this? Is it because my loop is running too many rotations at once, indefinitely. If your wondering this is that simple line of code.
while true do
handle.CFrame = handle.CFrame * CFrame.Angles(0.1,1,0)
end
I was thinking of changing it to a while wait() do loop. On another note, I really don’t want to be running 100 handles at once. Is there any way to have the rotation more smoother and efficient, and not all at once?
For the smooth part of the rotation I was thinking of using renderstepped(client) or heartbeat(server). Additionally I could use RunService as well.