-
Notifications
You must be signed in to change notification settings - Fork 45
Event is not automatically added #149
Comments
The events are inclusive of the Tilemap itself, and not outside. This was actually done intentionally. I tried to do it otherwise, but I had ran into issues where you have to actually push it in as an argument, making it a bit awkward to use. The Tilemap is meant to act like it's own standalone asset server though. This was done through discussions with some, including some insight from cart who generally agreed with my approach. You can get the events from If you have an alternative solution where Tilemap can hold |
@joshuajbouw I'm not familiar enough with the Bevy internals to be of any help here. But I am unsure then how to use In my
Then I have the system: pub fn chunk_event_handler(query: Query<&Tilemap>) {
if let Ok(map) = query.single() {
let events = map.chunk_events();
let mut reader = events.get_reader();
for event in reader.iter(events) {
match event {
TilemapChunkEvent::Spawned { point } => {
println!("Spawned {:?}", point);
}
_ => (),
}
}
}
} The intention is that the But here's the output we get:
Edit: It seems that using my own |
Note that if I manually This is particularly an issue with |
Note that this also causes a race condition; if my
However, if my generate chunk event handler happens after, we get the same issue as before. Auto chunk does not create the chunk requested by auto spawn, and we get this:
And nothing is drawn to the screen. |
Bevy Tilemap version
0.4.0
What you did
In Bevy 0.5, the following pattern should work:
However, we get:
Perhaps the
TilemapPlugin
does not callapp.add_event::<TilemapChunkEvent>()
?The text was updated successfully, but these errors were encountered: