Components Missing in GameObject on Load

Discussion and help for Easy Save 3
Post Reply
Posts: 3
Joined: Mon Jun 10, 2024 12:35 pm

Components Missing in GameObject on Load

Post by Khmerhero »


I have a GameObject that I want to save which contains a script Component. When I load the GameObject, it seems that the script attached to the GameObject is not loaded correctly.
Image_1_error.png (145.25 KiB) Viewed 718 times
This image shows that I set this.gameObject to TotalCardsBoughtAchievement. I then save the GameObject into the key "TotalCardsBoughtAchievement".
Notice how in the bottom right ( showing the local variables), there are 4 components, One which is InfiniteRunner.Achievements.BuyCardAchievements script.

When I load this GameObject on Start up; I have a simple if statement:
image_2_error.png (18.52 KiB) Viewed 718 times
I load the data into the GameStatsData.TotalCardsBoughtAchievement gameobject.

On load, I set buy_card_achievement to the GameStatsData.TotalCardsBoughtAchievement GameObject.

but notice how there is a component missing . The InfiniteRunner.Achievements.BuyCardAchievements script
missing component.png
missing component.png (131.63 KiB) Viewed 718 times
I was wondering if there were more steps that needed to be done inorder to save a GameObject. I was successfully able to save a list of GameObjects prior to this issue for my game, but this is the first time I'm trying to save a single GameObject.

Thank you.
User avatar
Moodkie Staff
Posts: 4896
Joined: Wed Nov 07, 2012 10:32 pm

Re: Components Missing in GameObject on Load

Post by Joel »

Hi there,

Have you added support for the Component as described in the Saving and Loading GameObjects guide? ... s-prefabs/

Only explicitly supported Components will be saved and loaded because otherwise a Component can't be assumed to be serializable at runtime.

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