Question about how to use the unity exporter properly

Hello everyone,

I am very new to Babylon.js, and somewhat new to TypeScript and game development. I’ve begun working on a world conquering game similar to RISK in Babylon.js using the unity exporter. I love Babylon so far and have found the unity exporter extremely helpful!

However, being new to Babylon and game development in general, I’m a bit confused on where to put my game logic and classes. Would I put my main game logic in the scene controller script? Where can I declare classes so they can be found by my other scripts?

There is very limited documentation on the Unity exporter and I haven’t been able to find an example project. If I were to see an example project using the exporter, I believe I could get an understanding of the layout much quicker.

Any help or guidance would be greatly appreciated!

Thanks,
Stefan

Calling @MackeyK24 to the rescue!

I would put scene level specific code in your scene controller class. You can simply add new .ts and .bjs that have raw script or classes … they get packaged up together with all your other script components and bundled as your project.js

Thank you for clarifying that! That was my assumption, but I just wanted to be sure. You’ve done a great job making this incredibly helpful toolkit and I hope to see it (and it’s docs/examples) continue to grow. For anyone else looking for examples using the toolkit, I found this repo, created by @David_Zwart, which will hopefully continue to be updated.

1 Like

Thanks for mentioning! I will definitely improve it later. I ended up with GUI stuff and how to interact with it. It was all a bit clunky.

Maybe in June! Let me know if you get stuck somewhere