I know that probably partially related to DOTS, but still, as it happens in baking worker threads. The issue is if you call any Unity Object.GetInstanceID() on main thread it will return value, but if you call it from any baker, baking system etc. for completely the same object (both directly loaded from AssetDatabase without creating any additional instances) it will return completely different value. Is this intended? If it's not supposed to be called from baking worker threads - why it doesn't throw (as GetInstanceID has default Unity main thread validation Object.CurrentThreadIsMainThread() probably it's suppressed for baking worker threads?). Don't know whom I should ask, probably @tender lance can redirect this question?
#[BUG?] GetInstanceID in Baking phase worker thread returns different value
1 messages · Page 1 of 1 (latest)
baking runs on background unity instances
not just on worker thread
It runs in background asset importer instance not full editor isn’t it? Still doesn’t change the fact of initial problem.
full editor
it has it's own .net runtime basically
as well as scenes
I mean, it's probably a deserialized version of the object
is one instance id positive and the other negative?
Both positive, just different value for same object, debugged this and they both points to same scriptable object (different in context of GetInstanceId from any place in editor is the same and call from any baker is different instance id) as result compare instance id from some cache made in editor before baking wouldn’t work as values not match 🙂