I have a float variable which moves to my HUD widget. It’s the distance I travel but I want to to reset to zero when I am in the main menu. What do I do?
Game Instance
HUD Widget Text
The Widget In-Game
I have a float variable which moves to my HUD widget. It’s the distance I travel but I want to to reset to zero when I am in the main menu. What do I do?
Game Instance
HUD Widget Text
The Widget In-Game
First of all, is there a reason for you to push the data into the GI and then have the player pull it from there AND then have the widget pull it out of the player every frame by updating the Game Instance, again every frame?
Sounds super-duper over-engineered but you may have a good reason, just asking. My bet is that you’re attempting to have values persist between map loads. Is that correct?
I want to to reset to zero when I am in the main menu. What do I do?
Set both variables to 0.
Or, perhaps, you could briefly explain what the end goal is. Almost certain there’s a more organised way to do it all.
The main reason it’s like this is because I have many levels the player travels through and stack up all the way to the end of the game. For now I just have it where I want it to reset at the main menu level.
Do you have any suggestions?
As above, set both vars to 0.
The main reason it’s like this is because I have many levels the player travels through and stack up all the way to the end of the game.
I’d just keep in the GI, there’s no reason to keep the player involved in this since they get destroyed anyway, right?