#ecs_tilemap / ldtk entity missing component for animation?
12 messages · Page 1 of 1 (latest)
have you checked the query itself is actually empty?
asking just cause the dbg log is nested, so the deserilization could have failed
I'm pretty sure it's empty: fn process_map( mut commands: Commands, tilemeta: Query<(&Transform, &TileMetadata, Entity, &TileTextureIndex), Added<TileMetadata>>, ) { for (transform, tile_meta, entity, _) in tilemeta.iter() { dbg!(tile_meta); } } is empty, and populates when &TileTextureIndex is exluded.
I'm doing a fairly basic bevy_ecs_ldtk setup otherwise as: ```
impl Plugin for Map {
fn build(&self, app: &mut bevy::prelude::App) {
app.add_systems(OnEnter(AppStates::Setup), setup);
app.insert_resource(LevelSelection::index(0));
app.add_systems(Update, process_map.run_if(in_state(AppStates::Setup)));
}
}
pub fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
let map_handle: Handle<LdtkProject> = asset_server.load("maps/beach_0.ldtk");
commands.spawn(LdtkWorldBundle {
ldtk_handle: map_handle,
..Default::default()
});
}```
Also if i omit the &TileTextureIndex I can read the meta properly so i'm pretty sure that part is OK at least.
and how/when r u adding TileTextureIndex?
I'm not manually doing it. It's coming from bevy_ecs_tilemap which is being used by bevy_ecs_ldtk
my bad, I thought that was yr component
in that case, have u tried running it without the added filter in case there're some ordering issues?
fn process_map(
mut commands: Commands,
tilemeta: Query<(&Transform, &TileMetadata, Entity, &TileTextureIndex)>,
) {
for (transform, tile_meta, entity, _) in tilemeta.iter() {
dbg!(tile_meta);
}
}
Yes and it gets the same result unfortunately
nothing else comes to mind, sorry