This isn’t exactly a scripting help question even though it’s tangentially related. I’ve encountered what seems like an engine bug but I can’t post a bug report so this is the only place I can think of.
I’m working on a weapon system and I have text labels to reflect how much ammo you have. So far it’s working fine but I noticed sometimes when I shoot the gun the text doesn’t update to show you’ve spent a round, e.g. dropping from 30 to 29. Obviously I immediately thought something was wrong with my code; I double checked and everything looked in order. Then, while testing I randomly noticed that the text does update, but only after I’ve resized the viewport or moved my mouse over the text label.
I have a screen capture of this happening:
Gyazo GIF
I take two shots. The first shot goes from 30 to 29 as expected. After the second shot, it stays at 29 until I resize the viewport.
I’m not really sure what’s going on here; The only time I’ve ever seen an issue like this is with CanvasGroups sometimes not updating.
If somebody has any idea what’s going on, or perhaps another place that would be better to ask, any help is appreciated.