-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Perhaps I'm confused on the naming here but it feels like the only way to interpret this property in a way that lines up with what it does is to read it as "this is an auto-remove target" rather than "this will auto-remove the target". Could someone help me to understand how to properly interpret this?
To use the example from the docs:
const ChildOf = relation({ autoRemoveTarget: true })
const parent = world.spawn()
const child = world.spawn(ChildOf(parent))
const grandchild = world.spawn(ChildOf(child))
parent.destroy()
world.has(child) // False, the child and grandchild are destroyed tooIn this situation, the target of ChildOf(parent) is parent, correct? But creating that relationship doesn't result in parent being automatically destroyed when child is (it's the opposite).
Am I mixing up what "target" means in this context?
Thanks for the help.
p.s. Seems every library I use by pmndrs is excellent. Kudos on the great work.
krispya
Metadata
Metadata
Assignees
Labels
No labels