Your page and your Unreal application can talk to each other in both directions. This page covers all four cases, for both the SDK and the iframe, so you can see them side by side rather than choosing a method first.
One call. Whatever you pass arrives in your app.
e3ds_controller.sendToUnreal("This message is sent by the frontend");
// objects work too
e3ds_controller.sendToUnreal({ Character: "Aurora" });
You post a message to the frame, and the message must be a JSON string carrying a specific command key:
const message = {
cmd: "sendDataToUE", // required, exactly this
value: { message: "Hello World!" }
};
// Send it as a STRING. A plain object is dropped without an error.
document.getElementById("iframe_1").contentWindow
.postMessage(JSON.stringify(message), "*");
The Unreal side is identical for both integration methods. In the Blueprint where the event happens:
Open the Actor Blueprint, press Add Component in the Components panel, and add Pixel Streaming Input. Without it the node below has nothing to send through.
Right-click in the graph, add Send Pixel Streaming Response, and give it the string you want the page to receive.
e3ds_controller.callbacks.onResponseFromUnreal = function (descriptor) {
console.log("Message from Unreal:", descriptor);
};
Assign it before the stream starts. Callbacks are optional — the ones you do not define are simply never called — but one assigned late has already missed whatever arrived first.
Listen for messages from the frame and read the payload the same way you would
any postMessage. What your Blueprint sent is the message itself,
event.data, exactly as sent — not wrapped in another field:
window.addEventListener("message", function (event) {
console.log("From Unreal:", event.data);
});
The frame also posts its own status messages (they carry a type),
so check the shape before treating a message as yours.
| You want to | Use |
|---|---|
| Send your own data — a name, a colour, a choice | sendToUnreal, and handle it in your Blueprint |
| Change something the platform understands, such as resolution | sendCommandToUE |
| Run an Unreal console command | sendConsoleCommandToUE |
The distinction matters: sendToUnreal reaches your code
and does whatever you wrote. The other two reach the engine and the platform,
and do fixed things.
Quality, resolution, fullscreen, mouse behaviour and screenshots.
Last updated