- Home /
How do I load customized characters into my next scene?
Hello!
For the past week or so I have been modifying the Character Customization framework that was graciously provided by Unity ( http://blogs.unity3d.com/2009/11/25/character-customization-assetbundles/ ) and am finally satisfied with my current results. I do know that this is a little outdated but character customization is not a huge feature of my game.
The next step is, obviously, to load the character(s) into the first level (a new scene) but I am lost as to how to go about doing this... Any help would be greatly appreciated and I believe that a simple shove in the right direction will be more than sufficent.
As a side note I am not too attached to my current method of character customization so if anyone has a good (free) alternative to the one linked above I'd also welcome that. (I have a Unity Pro license that is sponsored through my university so anything that uses assetbundels are fine.)
Thanks!
Answer by xander999 · Jul 01, 2013 at 10:37 PM
Here's an idea, try making a new customization system that generates a series of random numbers based on the different parts used (Each part has it's own number and they join up) then it is saved as the name of a text file, so then you open the text file on the next scene and the game imports the character?
The character customizer already had a method that did pretty much exactly that. I just ended up adding this string to the player data class I already made. With a bit of elbow grease I was able to get it to load the pre-customized character with this string but it is hit and miss for when it works.
Thanks for your suggestion though!
Answer by MiKo51 · Jul 01, 2013 at 11:31 PM
I'm not too familiar with the Character Customization framework but if you want to keep any GameObject into the next scene you can call DontDestroyOnLoad(GameObject toKeep) and that GameObject will not be deleted until you call Destroy on it, even if you change scenes.
DontDestroyOnLoad (transform.gameObject);
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
error CS0117: `Time' does not contain a definition for `deltaTime' 1 Answer
java to C# 2 Answers
MySql Online Character About 0 Answers
animation.isPlaying always true and Animation stuck at time 0 0 Answers