Forum rules - please read before posting.

Error when saving on iOS

Hey there, I've been encountering a strange bug when AC saves both in the Unity Editor (platform set to iOS), and also in iOS builds. Unity version is 2022.3.17f1, AC version is 1.81.0

Here is the error message

InvalidOperationException: AC.AttachmentPointData cannot be serialized because it does not have a parameterless constructor.
Rethrow as InvalidOperationException: Cannot serialize member 'AC.PlayerData.attachmentPointDatas' of type 'AC.AttachmentPointData[]', see inner exception for more details.

I should also mention that I have altered a little bit of the data path code for my own uses, but it should be the same as far as iOS is concerned. Here is the block of code I've edited in SaveSystem.cs

public static string PersistentDataPath
        {
            get
            {
                if (string.IsNullOrEmpty (persistentDataPath))
                {
                    #if UNITY_STANDALONE_OSX
                    persistentDataPath = Application.dataPath + "/PuzzlerSaveFiles";
                    #elif UNITY_STANDALONE_WIN
                    persistentDataPath = Application.dataPath + "\\PuzzlerSaveFiles";
                    #endif
                    #if UNITY_ANDROID
                        persistentDataPath = Application.persistentDataPath;
                    #endif
                    #if UNITY_IPHONE
                        persistentDataPath = Application.persistentDataPath;
                    #endif

                }
                return persistentDataPath;
            }
        }

Any thoughts on how to fix this?

Comments

  • I believe this was addressed since v1.81. If you import AC's latest release in a backup/duplicate project, does the issue remain?

  • edited January 14

    That did the trick! Thanks for the help! : D

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.