- Home /
Save/Load XML crashing?
I built a script to save/load based in Save and Load from XML tutorial to define the character material that the player will use in another scene. Everything works perfectly inside Unity, but:
1- When i export the game to Web Player, the Unity Script crashes in the character selection (save game); 2- When i export the game to PC Standalone, the second scene load without character material and the first scene (Character Selection) is still show at the background of the second scene.
Any help? I'm using Unity 4 to build the game.
Thanks.
Answer by abi-kr01 · Feb 25, 2014 at 09:43 AM
1)first of all the code that u have implemented is for stand alone not for web so it will surely don't work for web .
2)as you can c the when u click save ,script search inspector for object of type game object and stores whatever it finds during the save event.and next time when you load it it will load the whole game object regardless of what ever present in the scene.
Solution:
for 1)you can referthis link for load from server
2)you can delete the present game object that are already present in inspector (using destroy function)after everything load.you can do that by using load xml() function which is present in bottom of ur code