Well, when I press play after making a change on the player prefab, it seems to just not load the player into the scene at all - it's not in the hierarchy. But the console doesn't throw any errors.
The errors come when I switch from mouse controls to keyboard/controller mode (I allow the player to switch between these in-game, though the same errors happen if I manually change the control mode in the AC window before pressing play). It makes sense though because there can't be a hotspot proximity check etc if there is no player to check against.
NullReferenceException: Object reference not set to an instance of an object
I went to check it it out, but I couldn't find any change before and after amending the player settings - the prefab is tagged as Player, it's still set as the player char in the Settings Manager, the GameEngine prefab has the MultiSceneChecker (in the scene as well), and re-importing it doesn't appear to change anything about the prefab. It's quite baffling.
I checked if it only happened with changes to the player component, but it also happens if I for instance change the mass of the rigidbody or the size of the circle collider. Same in all the scenes.
I'm trying to think if I did anything, but the only thing I can think of is that I didn't update all the preference files, you know, tag manager, build settings etc. I usually never do, because then they overwrite my custom inputs and things like that, but I don't know, maybe one of those had something important?
I'm getting an error when moving between scenes in the latest AC/Unity 5.2.1. The screen goes black but it doesn't crash. Any idea what is going on? The only thing I've been working on lately are translations. This is the error message:
InvalidOperationException: <VisibilityData xmlns=''> was not expected
@ChrisIceBox: Occurs on both IOS and in editor, haven't switched platform. Tried an older backed up project with an earlier version of AC and no problems there, so seems to have been introduced with the latest/later version of AC.
It appears to happen when going from one scene to a previously visited scene.
Can this be related to the added Auto-add save components to GameObjects feature? I tried deleting a Remember Movable script that was auto-added to an object, and that particular scene is working again.
I think it's more about the save scripts in general on iOS. Try changing the save method from XML to Json - you can do this by opening up SaveSystem.cs and inserting the following at the top of the GetSaveMethod() function (around line 361):
I can't seem to reproduce the error after I went over and deleted superfluous scripts, but if it occurs again I'll try to switch to Json, thanks for the hint!
No, I mean scripts that were auto-added when using Auto-add save components to GameObjects, especially Remember Movable that really weren't needed.
EDIT: I just tried an iOS build, and it still crashed. I changed to json in SaveSystem.cs and after a recompile it appears to be working. I'll test some more.
It could be down to your device's software, or your iOS build settings - mine works when Api Compatibility Level is .Net 2.0 Subset, and Scripting Backend is Mono2X.
As Json seems the safer option, I'd ideally like to make it the new default - but it may give grief to those who already have save games/data that won't be compatible.
Api Compatibility Level is .Net 2.0 Subset, and Scripting Backend is Mono2X.
adjusted the SaveSystem.cs to json.
Getting a EXC_BAD_ACCESS hard crash when loading a saved game on the iPad air 2.
If I set the backend to IL2CPP and SaveSystem.cs to XML I get the same error as before, a visited scene won't load properly:
InvalidOperationException: <VisibilityData xmlns=''> was not expected
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObjectXML[T] (System.String pXmlizedString) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObject[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.Serializer.LoadScriptData[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.RememberMoveable.LoadData (System.String stringData) [0x00000] in <filename unknown>:0
at AC.ConstantID.LoadData (System.String stringData, Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.LevelStorage.ReturnCurrentLevelData (Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.SceneSettings.OnStart () [0x00000] in <filename unknown>:0
at AC.MultiSceneChecker.Start () [0x00000] in <filename unknown>:0
Rethrow as InvalidOperationException: There is an error in XML document.
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObjectXML[T] (System.String pXmlizedString) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObject[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.Serializer.LoadScriptData[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.RememberMoveable.LoadData (System.String stringData) [0x00000] in <filename unknown>:0
at AC.ConstantID.LoadData (System.String stringData, Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.LevelStorage.ReturnCurrentLevelData (Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.SceneSettings.OnStart () [0x00000] in <filename unknown>:0
at AC.MultiSceneChecker.Start () [0x00000] in <filename unknown>:0
(Filename: currently not available on il2cpp Line: -1)
Comments
In-between amending your player and pressing play, is it still tagged as Player and listed in your Settings Manager as the default prefab?
return SaveMethod.Json;
As Json seems the safer option, I'd ideally like to make it the new default - but it may give grief to those who already have save games/data that won't be compatible.
InvalidOperationException: <VisibilityData xmlns=''> was not expected
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot () [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObjectXML[T] (System.String pXmlizedString) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObject[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.Serializer.LoadScriptData[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.RememberMoveable.LoadData (System.String stringData) [0x00000] in <filename unknown>:0
at AC.ConstantID.LoadData (System.String stringData, Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.LevelStorage.ReturnCurrentLevelData (Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.SceneSettings.OnStart () [0x00000] in <filename unknown>:0
at AC.MultiSceneChecker.Start () [0x00000] in <filename unknown>:0
Rethrow as InvalidOperationException: There is an error in XML document.
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObjectXML[T] (System.String pXmlizedString) [0x00000] in <filename unknown>:0
at AC.Serializer.DeserializeObject[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.Serializer.LoadScriptData[T] (System.String dataString) [0x00000] in <filename unknown>:0
at AC.RememberMoveable.LoadData (System.String stringData) [0x00000] in <filename unknown>:0
at AC.ConstantID.LoadData (System.String stringData, Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.LevelStorage.ReturnCurrentLevelData (Boolean restoringSaveFile) [0x00000] in <filename unknown>:0
at AC.SceneSettings.OnStart () [0x00000] in <filename unknown>:0
at AC.MultiSceneChecker.Start () [0x00000] in <filename unknown>:0
(Filename: currently not available on il2cpp Line: -1)