Jump to content

Unity Exporter "Build Script" button question


Recommended Posts

Hello everyone,

I am a newbie in BabylonJS and I am having a question about the "Build Script" button at the exporter plugin. I an export and preview the scene, but when i am trying to build the scripts i am getting the errors in the attachments. Also i noticed that we can create typescript classes in Unity, how can I embed them in my game?


the full typescript error log is the following:

(function (exports, require, module, __filename, __dirname) { MZοΏ½
SyntaxError: Invalid or unexpected token
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:423:7)
    at startup (bootstrap_node.js:147:9)

Link to comment
Share on other sites

Hello again,

I solved this issue, it ws a problem with the terminal call in the "Babylon/Source/Tools.cs" file. I can post my solution if you want.

Now i am having a new issue, when i am creating a SceneController I am getting these two warnings in chrome browser:

  • function not found: PROJECT.BallSceneController
  • Failed to locate valid BABYLON.SceneController metadata instance


everything is ok at the end my problem was that i was trying to use ms typescript compiler path and not the nodejs one. I just made a fix in Tools.cs because it had a problem with spaces in the paths.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...