Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🐛 Sending a callback event on the same frame as AddStaticScript it fails #469

Open
Labels
bugSomething isn't working
@Ownezx

Description

Summary

I would want to load a script and execute a callback on the same frame. For instance, I load a scenario and I want to trigger the on_scenario_start function.

commands.queue(AddStaticScript::new(handle.clone()));
events.write(ScriptCallbackEvent::new_for_all_scripts(
 OnTest,
 vec![],
));

I get :

2025年08月28日T22:10:18.921977Z ERROR bevy_mod_scripting_core::handler: error in script `id AssetId<bevy_mod_scripting_core::asset::ScriptAsset>{ index: 0, generation: 0}`: Missing context for script id AssetId<bevy_mod_scripting_core::asset::ScriptAsset>{ index: 0, generation: 0}. Was the script loaded?..
Context:
Lua

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

        AltStyle によって変換されたページ (->オリジナル) /