How to use HeartBeat properly?
I was trying to make a house where each part of the building disappears one by one. I was using a wait command in the for loop and realized it was too slow, and I learned that using HeartBeat did it per frame and would be faster.
01 | local house = script.Parent |
02 | local runservice = game:GetService( "RunService" ) |
04 | for i,v in pairs (house:GetChildren()) do |
07 | v.Transparency = v.Transparency + 0.5 |
08 | wait(runservice.Heartbeat) |
This is my code that uses the HeartBeat. I made an identical one to this except made wait() blank. After running both of them they both were the same speed. Can someone let me know how to use HeartBeat properly?