{"record":{"id":"58075a535aac20cd","repo":"FyroxEngine/Fyrox","slug":"script-message-message-was-sent-but-there-s-n","errorCode":null,"errorMessage":"Script message {message:?} was sent, but there's no receivers. Did you forgot to subscribe your script to the message?","messagePattern":"Script message (.+?) was sent, but there's no receivers\\. Did you forgot to subscribe your script to the message\\?","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-impl/src/engine/mod.rs","lineNumber":466,"sourceCode":"        resource_manager: &ResourceManager,\n        dt: f32,\n        elapsed_time: f32,\n        message_sender: &ScriptMessageSender,\n        user_interfaces: &mut UiContainer,\n        graphics_context: &mut GraphicsContext,\n        task_pool: &mut TaskPoolHandler,\n        input_state: &InputState,\n        error_queue: &mut ErrorQueue,\n    ) {\n        while let Ok(message) = self.message_receiver.try_recv() {\n            let type_id = match message.payload.get_dynamic_type_id() {\n                Some(it) => MessageTypeId::Dynamic(it),\n                None => MessageTypeId::Static(message.payload.deref().type_id()),\n            };\n            let receivers = self.type_groups.get(&type_id);\n\n            if receivers.is_none_or(|r| r.is_empty()) {\n                Log::warn(format!(\n                    \"Script message {message:?} was sent, but there's no receivers. \\\n                    Did you forgot to subscribe your script to the message?\"\n                ));\n            }\n\n            if let Some(receivers) = receivers {\n                let mut payload = message.payload;\n\n                match message.kind {\n                    ScriptMessageKind::Targeted(target) => {\n                        if receivers.contains(&target) {\n                            let mut context = ScriptMessageContext {\n                                dt,\n                                elapsed_time,\n                                plugins: PluginsRefMut(plugins),\n                                handle: target,\n                                scene,\n                                scene_handle,","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-impl/src/engine/mod.rs#L448-L484","documentation":"Engine::dispatch_messages routes script messages by payload type to registered receiver groups. If no script has subscribed to the message's type, the message is silently dropped and this warning is logged, hinting that the intended script likely forgot to subscribe.","triggerScenarios":"Calling script message dispatch (Engine::dispatch_messages, e.g. during handle_scripts or a ScriptMessageSender::send flow) with a message payload type for which no script registered via subscribe_to (on start or ScriptDeinitContext subscriptions).","commonSituations":"Typo or mismatch in the message type name; script that should receive the message was never instantiated or was removed; subscribing in the wrong lifecycle hook so registration never happened before dispatch.","solutions":["Call context.subscribe_to::<MessageType>() in the script's on_start for each message it handles","Verify the script instance that should receive the message exists on some scene node","Check the message type matches exactly what receivers subscribed to"],"exampleFix":"// before\nfn on_start(&mut self, context: &mut ScriptContext) { /* no subscription */ }\n// after\nfn on_start(&mut self, context: &mut ScriptContext) {\n    context.subscriptions::<MyMessage>();\n}","handlingStrategy":"validation","validationCode":"// before sending\nlet will_receive = engine.has_script_subscribers::<MyMessage>();\nif !will_receive { log::warn!(\"no receivers for MyMessage; check subscriptions\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Subscribe scripts in on_start via subscribe_to for every message type handled","Verify the receiving script exists in the scene before sending","Don't treat sends to zero receivers as delivery; check the log"],"tags":["scripts","message-passing","fyrox"],"backgroundTag":"no-message-receivers","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}