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
Empty ES3 game object being created
-
- Posts: 6
- Joined: Sun Nov 01, 2020 7:33 pm
Empty ES3 game object being created
- Attachments
-
- es3.png (10.59 KiB) Viewed 998 times
Re: Empty ES3 game object being created
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
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
-
- Posts: 6
- Joined: Sun Nov 01, 2020 7:33 pm
Re: Empty ES3 game object being created
Thank you Joel, I'll give that a shot.
-
- Posts: 6
- Joined: Sun Nov 01, 2020 7:33 pm
Re: Empty ES3 game object being created
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.