#How to get id's from spawn_batch? (Edit: Wrote spawn_bundle instead of spawn_batch)
1 messages · Page 1 of 1 (latest)
let enemy = commands
.spawn(EnemyBundle::new(enemy_meta, pos.extend(100.0)))
.id();
level.enemies.push(
enemy,
);
I apologize for the confusion, I meant spawn_batch and not spawn_bundle.
How to get id's from spawn_batch? (Edit: Wrote spawn_bundle instead of spawn_batch)
I don't think there is a way to get those IDs since the spawn_batch command is deferred. To get around this, you could consider adding your own ID components to the bundle and using that to identify the entities later to extract the Entity ID
So kind of add a intermediate marker which then can be traced back with a Query?