#Bundles as items in Vec<>
15 messages · Page 1 of 1 (latest)
I am able to do it for Component, but not for Bundle
Bundles can't be used dynamically atm. Maybe storing the spawn commands in a CommandQueue to apply later in an exclusive system works for you.
This is the command you'll need to push to the queue: https://docs.rs/bevy/latest/bevy/ecs/system/struct.Spawn.html
Ah, nice. This is something I wanted to emulate with the Vec, cool it's already there just to be used!
Umm, I just found this
It looks like there is a way to push bundles into a vector???
Oh I see it
It's the same type
(name, score)
it wouldnt work if one of the items was different type
Haa, seems like commandqueue is a bit difficult to use
I have to manually construct commands from exposed world
Yeah, it's not as pleasant. You could access the regular Commands api via Commands::new_from_entities. https://docs.rs/bevy/latest/bevy/ecs/prelude/struct.Commands.html#method.new_from_entities