Loade Multiple Javascript

Hello guys,
I want to try to use multiple Javascript which are loading different object files to get an better overview of the project.
Is there any way to do it exapt creating multiple scene and connect them?

Thank you

Sure is :smiley:. You can load js in your scene like this:

var url = "https://myserver.com/myfile.js";
var s = document.createElement("script");
s.type = "text/javascript";
s.src = url;

Additionally you can perform actions only when the script is loaded. Something like this:

s.onload = function() {
console.log(“do something only after script is loaded”);

Hope this helps,

i tried this but it dont want to work.

script 1

script 2

that is because gebaude needs to be a function and not a return value of a function (that returns void, btw :-)). If it’s not a function, the import will run before the script was loaded.

It should be roughly:

const gebaude = () => {
  //... do your thing
1 Like

Hello, just checking in, was your question answered? @SIMON_Nagel