Hi Joel,
I have a custom class ReferenceHolder that contains a field called copyObject. In this copyObject field I store reference of a gameObject. For example, I have two gameObjects A and B, with A having a copyObject reference to B and vice-versa.
These gameObjects are deleted during runtime. With ES3, I can save the deleted gameObjects without any problem. However, when I load the deleted gameObjects back, the reference in copyObject field is only restored for one of the gameObjects and not both. Could you please help me with how I could restore the references between both the gameObjects?
Best,
Vik
References between two GameObjects
Re: References between two GameObjects
Hi there,
This is because one of the GameObjects will not exist when you load the other. In this case you would need to load twice, or save the Components in question separately and load them afterwards.
All the best,
Joel
This is because one of the GameObjects will not exist when you load the other. In this case you would need to load twice, or save the Components in question separately and load them afterwards.
All the best,
Joel
-
- Posts: 8
- Joined: Thu Mar 03, 2022 8:16 pm
Re: References between two GameObjects
Thanks for your quick answer. I can confirm that it works like a charm!