Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the RotationCube in HelloCube-Reparenting have Child components from the beginning #279

Open
00nico00 opened this issue Dec 12, 2023 · 1 comment

Comments

@00nico00
Copy link

00nico00 commented Dec 12, 2023

When I was reproducing the HelloCube-Reparenting example, I directly right-clicked on the RotationCube to create a new child object, Cube. This parent-child relationship only exists within the UnityEditor and does not involve ECS Parent and Child components (originally, I thought this relationship would be automatically converted during baking). As a result, I encountered errors when reproducing it on my own (until I initialized attached as false). When I examined the scene of the official example, I noticed that the RotationCube comes with a Child Buffe. I would like to know how this was achieved.
Cache_-1bae7be1119a3f7a

@noble-shake
Copy link

noble-shake commented Nov 7, 2024

Dynamic Buffer will automatically added.

https://docs.unity3d.com/Packages/[email protected]/api/Unity.Transforms.Child.html

Remarks
The ParentSystem automatically adds and manages this component and its contents. You can read this list, but you shouldn't add or remove buffer elements.

When an entity with this component is destroyed, the ParentSystem will automatically remove the Parent components from each child entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants