Quantcast
Channel: Answers for "Preserve global variable after game object destroyed?"
Browsing all 4 articles
Browse latest View live

Answer by Mike 3

Use a static variable for anything you want persisted like that - then it belongs to the class as a whole, not the instancee.g.static var score : float = 0;will persist the score for all versions of...

View Article



Answer by Tetrad

You could have an intermediary game object that stores the value for you. So you have script C that's on a game object that stays around forever and doesn't do anything but stores/loads values.You...

View Article

Answer by Mike 3

Use a static variable for anything you want persisted like that - then it belongs to the class as a whole, not the instancee.g.static var score : float = 0;will persist the score for all versions of...

View Article

Answer by Tetrad

You could have an intermediary game object that stores the value for you. So you have script C that's on a game object that stays around forever and doesn't do anything but stores/loads values.You...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images