BabylonJS / BabylonToolkit

Home of the community maintained Unity & Unreal exporters for Babylon.js
179 stars 47 forks source link

Could not make custom scripts work in the actual export #41

Closed KzMz closed 2 years ago

KzMz commented 2 years ago

Hi there, I just installed the Toolkit (version V5.0.0-A63.1X) on Unity 2021.1.6f1 and I started to play with it. If I don't add any custom scripts and I use only the default ones (like Default Scene Controller), everything compiles, exports, and works correctly even in the Web Preview.

When I start using any additional script (including the ones from the Starter Content) then the Web Preview get stuck during loading screen with the following message in the console log:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'AlleySceneController') at Function.n.InstantiateClass (babylon.manager.js:5) at babylon.manager.js:7 at Array.forEach () at Function.n.DoProcessPendingScripts (babylon.manager.js:7) at n.postProcessSceneComponents (babylon.manager.js:7) at Function.n.PostParseSceneComponents (babylon.manager.js:5) at e.startParsing (babylon.manager.js:7) at e.onComplete (babylon.manager.js:7) at r.callback (babylon.manager.js:7) at e.notifyObservers (babylon.min.js:16)

If for example I use the UniversalCameraSystem script what I'm getting is "Cannot read properties of undefined (reading 'UniversalCameraSystem'). If I check in the Export folder, I don't find anywhere any reference to the scripts I'm creating or the UniversalCameraSystem itself.

Could you give me some advice for this? Seems like it's not actually compiling every script other then the default ones. Thank you!

hquu commented 2 years ago

i have this error

MackeyK24 commented 2 years ago

Do you have typescript installed and the script compiler options enabled on the Toolkit Panel ?

MackeyK24 commented 2 years ago

npm install -g typescript