Unable to save and load all components within an object.

Discussion and help for Easy Save 3
Post Reply
tuanha
Posts: 12
Joined: Wed Jun 08, 2022 1:41 am

Unable to save and load all components within an object.

Post by tuanha »

The objects in the game consist of child objects, and these child objects contain components such as Mesh, RootBone, Animation, Material. However, when performing the es3.Save command and loading it back, not all the components mentioned above are fully present.

The following is my command.

Code: Select all

            GameObject[]  body_parts = ES3.Load<GameObject[]>(IdPlayer+ "_body_parts");// 
                    short[] body_types = ES3.Load<short[]>(IdPlayer+ "_body_types");

                ES3.Save<GameObject[]>(IdPlayer+ "_body_parts", body_parts);//Each object contains components: Mesh, RootBone, Animation, Material.
                 ES3.Save<short[]>(IdPlayer+ "_body_types", body_types);
Is there any way to save and load those components without admin privileges? I appreciate your help.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Unable to save and load all components within an object.

Post by Joel »

Hi there,

This is expected behaviour, see: https://docs.moodkie.com/easy-save-3/es ... s-prefabs/
This will save and load the following:
  • layer, tag, name and hideFlags.
  • Components on the Natively-supported types list, or those which have been manually supported using an ES3Type OR …
  • … if the GameObject has an ES3GameObject Component, only the Components selected will be saved (see the Choosing which Components are saved section below).
Also note that not every type of Component is serializable at runtime. For example Unity doesn't allow Animations to be saved at runtime.

In this case you would need to create a prefab which already contains all of the Components you need, and instantiate, save and load this (see the Saving and Loading Prefab Instances section for more info: https://docs.moodkie.com/easy-save-3/es ... 0instances)

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