-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Add set_parent
and remove_parent
to EntityCommands
#6189
Conversation
What is the value of creating a new |
Your comment made me realize that |
bors r+ |
I found myself doing ```rust let child = commands.spawn(..).id(); commands.entity(parent).add_child(child); ``` When that could just be ```rust commands.spawn(..).set_parent(parent); ``` Adding `set_parent` was trivial as it's just an `AddChild` command. Most of the changes are for `remove_parent`. Also updated some outdated docs. Co-authored-by: devil-ira <[email protected]>
Build failed (retrying...): |
I found myself doing ```rust let child = commands.spawn(..).id(); commands.entity(parent).add_child(child); ``` When that could just be ```rust commands.spawn(..).set_parent(parent); ``` Adding `set_parent` was trivial as it's just an `AddChild` command. Most of the changes are for `remove_parent`. Also updated some outdated docs. Co-authored-by: devil-ira <[email protected]>
set_parent
and remove_parent
to EntityCommands
set_parent
and remove_parent
to EntityCommands
…6189) I found myself doing ```rust let child = commands.spawn(..).id(); commands.entity(parent).add_child(child); ``` When that could just be ```rust commands.spawn(..).set_parent(parent); ``` Adding `set_parent` was trivial as it's just an `AddChild` command. Most of the changes are for `remove_parent`. Also updated some outdated docs. Co-authored-by: devil-ira <[email protected]>
…6189) I found myself doing ```rust let child = commands.spawn(..).id(); commands.entity(parent).add_child(child); ``` When that could just be ```rust commands.spawn(..).set_parent(parent); ``` Adding `set_parent` was trivial as it's just an `AddChild` command. Most of the changes are for `remove_parent`. Also updated some outdated docs. Co-authored-by: devil-ira <[email protected]>
…6189) I found myself doing ```rust let child = commands.spawn(..).id(); commands.entity(parent).add_child(child); ``` When that could just be ```rust commands.spawn(..).set_parent(parent); ``` Adding `set_parent` was trivial as it's just an `AddChild` command. Most of the changes are for `remove_parent`. Also updated some outdated docs. Co-authored-by: devil-ira <[email protected]>
I found myself doing
When that could just be
Adding
set_parent
was trivial as it's just anAddChild
command. Most of the changes are forremove_parent
.Also updated some outdated docs.