About [WriteGroup(typeof(LocalToWorld))]

I want to implement a UnityEngine.Animations.ParentConstaint like component in entities, so i defined such a component data

[WriteGroup(typeof(LocalToWorld))]
struct ParentConstraint : IComponentData {}

and attach it to a child entity, then run in editor, i change it’s parent position in inspector manually, but the child move with parent automatically. Is that mean the LocalToWorldSystem still update the child’s LocalToWorld? or i mistake the WriteGroup functionality?

Thanks - looks like a bug. We’re going to talk about how best to fix this in 1.x.

Having looked at this more in depth this week, I no longer think this is a bug. The existing behavior - you move the root and the rest of the hierarchy follows - is the expected out-of-the-box behavior.

In your case, if you don’t want the child elements to move with the root, you have the option of adding a WriteGroup component (differently typed seems most useful) to the rest of the hierarchy. Does that solve your case?

1 Like

I want to implement IK in entities, and finally did it. The WriteGroup works fine in code, if I move parent in ISystem. Thank you very much!