You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot get data to transfer from a javascript variable to godot variable. Documentation is inadequate and provides no examples.
The use-case is using JavaScript I download a JSON file from API in on WebGL platform. The variable is playerId = "1234". I should be able to use JavaScriptBridge in GDScript to create a new variable:
var Player = JavaScriptBridge.create_object("String", "playerId")
Now the variable is in GDScript, I can use it through the game and display it on the UI. For example:
label.text = "Your ID: ", Player
and it should display Your ID: 1234
I know there's another issue like this, but it's labeled as a feature request. This is a bug because the documentation says this is supposed to work and it doesn't.
Please fix this.
JavaScript number is returned as [:ref:class_float](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id13) JavaScript boolean is returned as [:ref:class_bool](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id15) JavaScript string is returned as [:ref:class_String](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id17)
Version 4.3
I cannot get data to transfer from a javascript variable to godot variable. Documentation is inadequate and provides no examples.
The use-case is using JavaScript I download a JSON file from API in on WebGL platform. The variable is playerId = "1234". I should be able to use JavaScriptBridge in GDScript to create a new variable:
var Player = JavaScriptBridge.create_object("String", "playerId")
Now the variable is in GDScript, I can use it through the game and display it on the UI. For example:
label.text = "Your ID: ", Player
and it should display Your ID: 1234
I know there's another issue like this, but it's labeled as a feature request. This is a bug because the documentation says this is supposed to work and it doesn't.
Please fix this.
JavaScript number is returned as [:ref:
class_float](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id13) JavaScript boolean is returned as [:ref:
class_bool](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id15) JavaScript string is returned as [:ref:
class_String](https://github.com/godotengine/godot-docs/blob/4.3/tutorials/platform/web/javascript_bridge.rst#id17)
URL to the documentation page:
The text was updated successfully, but these errors were encountered: