I am working on a randomly generated game, and the random generation would include the character’s looks. I’m sure I would use this for other things, but for now I’ll just stick with the character example. So at the start of a scene, let’s say the character’s hair color is randomly generated. When the player exits the scene, and it loads the next one, I want that character to have the same hair color. I have a script that spawns the player at a certain position in this scene using the “Player” prefab.
So let’s say the original player prefab had black hair, and then at the start of a scene the hair color was changed to red. Now I want to save that new player into the “Player” prefab, so that in the next scene, I can spawn the “Player” prefab and it will still have the red hair that was chosen in the last scene. That’s the best example I can think of. So basically, is there a way to overwrite a specific prefab with a new gameobject during runtime?
Edit:
I read something online about being able to do it with editor scripts, but I couldn’t find anything on what exactly that means. Could anybody point me in the right direction?