Entity with multiple SceneBundles
For example, I have a field, which can contain different plant types. I have the field model and different plant models and I want to have everything in one entity.
- Tile entity
- Tile model
- Plant model
If I try it like this:
commands
.spawn()
.insert(Tile {
plant: Plant { ... },
})
.insert_bundle(SceneBundle { ... })
.insert_bundle(SceneBundle { ... });
Then only the last SceneBundle get's added or I guess it overwrites the first Scene bundle.
If I try it like this
commands
.spawn()
.insert(Tile { ... },
})
.with_children(|parent| {
parent.spawn_bundle(SceneBundle { ... });
parent.spawn_bundle(SceneBundle { ... });
});
Then I get a Tile entity with two children SceneBundle entites but none of them are visible.
If anybody wants to try it out, the code is in src/lib/field.rs in the repo: https://github.com/pintariching/combinerr