ue4 how to fix when i actor destroy and respawn it again all variables get to 0
please help me this is very annoying
Try to change the default value in the blueprint.
If variables changed during gameplay, and you do not want to respawn with default values, you must somehow store the changed variables yourself - actors will not do it automatically.
- if the changes need to persist in this game session only and you’re not loading levels, store them in another actor that does not get destroyed and can serve as a manager
- if the changes need to persist in this game session only and we open new levels, store the pertinent variables in the Game Instance
- if the changes need to persist after closing the game, use a save game:
this is very annoying
Perhaps, but that’s the intended behaviour.