Page 1 of 1

Transform loading order

Posted: Wed Aug 31, 2022 3:07 pm
by Liens
Hello, I've been experiencing an issue where I've saved and then loaded a gameobject with children. But because ES3 loads the localPosition first, then loads the parent afterward, the loaded child is in the wrong position.

Meaning at the time when localPosition is set, parent = null which means it's setting world position (since null parent localPosition is the same as world position) before parenting it to the parent. Is this intentional behavior or am I messing something up?

Cheers.

Re: Transform loading order

Posted: Wed Aug 31, 2022 3:23 pm
by Joel
Hi there,

In these cases it’s usually required to load twice: once to load instances, and again to load their fields correctly.

All the best,
Joel

Re: Transform loading order

Posted: Wed Aug 31, 2022 3:28 pm
by Liens
Thanks. I'm not sure if it's a permanent fix but I had an idea to edit ES3UserType_Transform, putting the writer.Write("parent") line first means it will load first?

Re: Transform loading order

Posted: Wed Aug 31, 2022 3:44 pm
by Joel
Hi there,

This could also be a solution for your situation, depending on whether your issue is related to parent load order or general load order.

All the best,
Joel