Skip to content

🐛 Adding and remove script in the same function causes error #468

@Ownezx

Description

@Ownezx

Summary

I was trying to get a behaviour similar to before. I was using the fact that loading a script executed it to register scenarios to my app.

After my upgrade from BMS 0.13, I'm unsure how to reproduce the same behavior as before. I tried adding adding and removing the scenario on the same frame:

commands.queue(AddStaticScript::new(handle.clone()));
commands.queue(RemoveStaticScript::new(handle.clone()));

I got

2025-08-28T22:10:18.922027Z  WARN bevy_mod_scripting_core::commands: Attempted to delete static script id AssetId<bevy_mod_scripting_core::asset::ScriptAsset>{ index: 0, generation: 0}, but it was not found

Reproducing

https://github.com/Ownezx/bms_min_repro/issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions