Saving Prefabs doesn't work

Discussion and help for Easy Save 3
Post Reply
VIMAGE
Posts: 7
Joined: Sun Aug 16, 2020 1:35 pm

Saving Prefabs doesn't work

Post by VIMAGE »

Hey,
I tested it on my own scene, but always ran into an error, even though i followed different guides like this one:

https://docs.moodkie.com/easy-save-3/es ... s-prefabs/

I thought I did something wrong, so I tried for hours by now.
Then I found your example Scene:
https://moodkie.com/forum/viewtopic.php?f=18&t=1468

I thought yey, I will copy and modify that. But the same Error occures (see attachment)

What is the problem?

To specify what I want (should be very casual):

I have a game Object that stores furniture, all of the furniture are prefabs. They are added ingame as instances.
The next time I open the scene, the Prefabs Instances should be in the same position as before.
It worked with the normal object safe, but then it looses all the scripts, rigidbody etc. of the prefab. Ass suggested in the guide, I added a "ES3 Prefab" to the object, but as soon as I do that, the error starts to occure. As I said, it seams to be the same as in your example Scene.

Hope you can help me.

Kind Regards,
Mark
Attachments
PrefabProblem.JPG
PrefabProblem.JPG (48.33 KiB) Viewed 2018 times
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving Prefabs doesn't work

Post by Joel »

Hi Mark,

Please could you show me the code you're using to save and load? It's not possible to tell what is happening from what you've sent me, but it looks like you're trying to use an ES3SerializableDictionary, which is internal and should not be used.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
VIMAGE
Posts: 7
Joined: Sun Aug 16, 2020 1:35 pm

Re: Saving Prefabs doesn't work

Post by VIMAGE »

I get the error code already just by using your basic example Scene, nothing modified.
Attachments
SceneUsed.JPG
SceneUsed.JPG (143.25 KiB) Viewed 2015 times
VIMAGE
Posts: 7
Joined: Sun Aug 16, 2020 1:35 pm

Re: Saving Prefabs doesn't work

Post by VIMAGE »

For my own Scene, the code looks like this.

As you can see, I already tried to build a Workaround by saving and loading each element individually, because the autosave was not working. This code works, but it spawns only the Objects, not the prefabs, so every script + rigidbody etc. on them is missing.

As soon as I add ES3 Prefab component to the prefabs, the errorcode appears while trying to save.
Attachments
MyCode.JPG
MyCode.JPG (92.26 KiB) Viewed 2015 times
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving Prefabs doesn't work

Post by Joel »

Hi there,

Have you modified any of the Easy Save scripts at all? I'm not getting this issue at my end and I'm not sure how this could occur.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
VIMAGE
Posts: 7
Joined: Sun Aug 16, 2020 1:35 pm

Re: Saving Prefabs doesn't work

Post by VIMAGE »

No, at least not as I was aware of.
Probably best if I reinstall the plugin.

Haven't been working with Unity for too long, is there a best way to do so without "destroying" anything?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving Prefabs doesn't work

Post by Joel »

Hi there,

You can reinstall Easy Save by deleting the Assets/Plugins/Easy Save 3/ and Assets/Easy Save 3/ folder (if it exists), and reimporting from the Asset Store.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
VIMAGE
Posts: 7
Joined: Sun Aug 16, 2020 1:35 pm

Re: Saving Prefabs doesn't work

Post by VIMAGE »

Just to keep you up to date:

reinstalling the Plugin seams to have fixed it, first tests worked!
Just the Scriptable Object (Item) in a Script on the Prefab wasn't saved as the Instantiated Item that it acctually was and spawned as the original. But I just switched this with a clone of the original Item on spawn.
So it is currently working now *-*

Could you still please explain the reason, why the scriptable Object on the ES3 Prefab was not saved as instantiated, but as the original?

Thanks for your help! Especially considering it was sunday!
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving Prefabs doesn't work

Post by Joel »

Hi there,

Glad you've managed to make progress :)

Just to clarify, as the ScriptableObject is a field on a Component of the prefab, it will be saved by reference. If you want to save it by value, you should save it separately.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply