Open jannic opened 1 year ago
If there are multiple instances, score_q.get_single_mut() doesn't return any.
Therefore, if you started the game more than once, the score was always shown as 0.
So, instead of spawning a second instance, just clear out the existing one.
Not that I now close to nothing about bevy or ECS in general. So this might not be the right way to fix it. But it seems to work :-)
If there are multiple instances, score_q.get_single_mut() doesn't return any.
Therefore, if you started the game more than once, the score was always shown as 0.
So, instead of spawning a second instance, just clear out the existing one.
Not that I now close to nothing about bevy or ECS in general. So this might not be the right way to fix it. But it seems to work :-)