Empty ES3 game object being created

Discussion and help for Easy Save 3
Post Reply
easysaver333
Posts: 6
Joined: Sun Nov 01, 2020 7:33 pm

Empty ES3 game object being created

Post by easysaver333 »

Hello, I'm trying to load in some object and instead getting empty game objects with this error message.

I'm saving a list of transforms and loading it in, its working with the same set up and code for another list of objects so I'm not sure what I'm missing here.

I'm spawning a random number of random objects so I'd rather not have to do a LoadInto as the info will change.

Any pointers in the right direction would be useful.



Thanks
Attachments
es3.png
es3.png (10.59 KiB) Viewed 999 times
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Empty ES3 game object being created

Post by Joel »

Hi there,

A Transform (or any Component) cannot exist without a GameObject to attach it to, which is why this is being created. In this case you would need to use LoadInto.

Alternatively you could also save the length of the Transform array. Then when loading you would load this length, instantiate the required number of GameObjects, put their Transforms into an array and use LoadInto to load the data into that array.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
easysaver333
Posts: 6
Joined: Sun Nov 01, 2020 7:33 pm

Re: Empty ES3 game object being created

Post by easysaver333 »

Thank you Joel, I'll give that a shot.
easysaver333
Posts: 6
Joined: Sun Nov 01, 2020 7:33 pm

Re: Empty ES3 game object being created

Post by easysaver333 »

I ended up saving the position and rotation instead so I could use an object pool to move the item there instead of loading it in or instantiating.
Post Reply