I am trying to build a multilevel game where I want to be able to record certain values and maintain them when loading new levels. An example would be the number of hitpoints left on the player. If I use DontDestroyOnLoad, this works fine from one layer to the next, but if the character dies and is respawned during the course of gameplay on a particular level, then that script (and the object it is attached to) is then duplicated.
For example, I used to have the script to maintain hitpoint information attached to the player object (I have since changed that, but this is just an example). If the player completed the level, then he showed up in the next level just fine with all values intact. However, if he dies and was respawned (using loadlevelfade), there would then be two player characters on the level - obviously this doesn’t work.
The purpose of the answer is to get you to click on the button and discover the answer yourself. I like the question, in fact I’ve answered it literally a few dozen times.
Thanks for the link - now that wasn’t so hard was it? (even though the link doesn’t work) You could have posted that the first time instead of being a jerk about it.
Do a search - gee, I never thought of that - thanks. In fact I had searched, but perhaps I was not using the correct search terms - did you think of that?
Thanks for the “help”. I take it you don’t work in customer relations.
Yes, that brings up one other post (I thought you had answered this “dozens of times”?) entitled “Help: Code structuring and persistence ( memory managem” How stupid of me not to recognize this as the answer to my question!
Next time I will be sure to read all 122 pages of this thread before daring to waste the time of the almighty Quietus. :?