Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spawned blueprints are immediately despawned. #196

Open
andriyDev opened this issue Jul 20, 2024 · 2 comments
Open

Spawned blueprints are immediately despawned. #196

andriyDev opened this issue Jul 20, 2024 · 2 comments

Comments

@andriyDev
Copy link

The "root" entities remain, but all their contents are not there.

I was able to fix this with the following commented out line:

        commands.entity(original).remove::<SpawnHere>();
        commands.entity(original).remove::<Spawned>();
        // commands.entity(original).remove::<Handle<Scene>>();
        commands.entity(original).remove::<AssetsToLoad<Gltf>>(); // also clear the sub assets tracker to free up handles, perhaps just freeing up the handles and leave the rest would be better ?
        commands.entity(original).remove::<BlueprintAssetsLoaded>();
        commands.entity(root_entity).despawn_recursive();
    }

In line 95 of crates/bevy_gltf_blueprints/src/spawn_post_process.rs.

I'm not sure if this is the correct fix hence why it's not a PR. Perhaps in Bevy 0.14, the scenes are despawned if the handle is removed?

@kaosat-dev
Copy link
Owner

Hi @andriyDev , which version of the crate are you using ?
I noticed the same issue with the scene handles, but that is fixed for Blenvy in the upcoming release.

@andriyDev
Copy link
Author

@kaosat-dev I am using the main branch, so bevy_gltf_blueprint 0.11.0.

Ok sounds good! I figured with the new Blenvy release this would be the case, so this can probably be closed once that's all merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants