Make the `RelationshipTarget` component half of relationships optional
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
> Before the recent relations PR landed, the standard way to create custom relations was to only define a single component for them (analogous to Parent). Bevy 0.16's relationships need *two* components, one for each side of the relationship.
>
> We could also make the `RelationshipTarget` component optional (you don't always need to be able to search in the other direction).
_Originally posted by @alice-i-cecile in [#17412](https://github.com/bevyengine/bevy/issues/17412#issuecomment-2601057321)_
The primary motivation for this is performance: if you *know* that you're only ever traversing up the relationship we can save a lot of work when updating the relationship.
Contributor guide
Assessment
This issue has not been assessed yet.