HaRrYH
Normal2y ago
7 replies
HaRrY

How to clear RealtimeSet or RealtimeArray

I run matches on loop. And before I start a new match I have to clear the previous scores etc that are stored in RealtimeArray. Lets say there are 10 matches, each match has its score, now this score used to be stored in RealtimeArray, now I am using RealtimeSet so that I can clear it. So I cannot clear RealtimeArray and the only way I can clear RealtimeSet is by using this
while (model.advents.Any())
{
model.advents.Remove(model.advents.Last());
}
And even though I am doing the above only on 1 client sometimes I feel like its not consistent, I dont know even if I should do this or is there a better way to do this. Or how would you fellow normcorians have done it?
Was this page helpful?