Sample Code for Generic Items

Overall, I think the babylonjs documentation is excellent. For many features there is good sample code in the documentation. However, I’m still pretty new to using this framework, and as a “newbie” I often find myself looking up something in the documentation that is rather simple, and therefore often doesn’t have much in the way of sample code. As an example, if you look up the type “ValueAndUnit”, even though the documentation does an excellent job at describing the type and its methods, etc., there is no easily accessible sample code available (which can be extremely useful). So I have to search through a lot of random code to find sample usages, or simply figure it out by trial and error in my dev environment.

So I guess what I’m asking is this: Is there an easy way to find sample code for pretty much any basic function?


Hey welcome!
Sometimes it’s a good idea to have a look at THREE or even Unity examples. The terminology and the method/property names are quite similar. You can find info on some stuff even without targeting a specific framework when searching the web.


1 Like

cc @PirateJC

Hey @Slimfinger!

First and foremost, welcome to the Babylon family! We are sincerely grateful to have you here. We’re glad to hear that you’ve found the documentation to be helpful and useful, but also 100% recognize how it can still represent a steep learning curve for folks who are brand new to Babylon, or even 3D or the web in general.

I’ll tell you that the learning curve for “newbies” is a personal passion of mine. I consider myself a fairly terrible developer and FAR FAR below the experience and expertise of countless amazingly talented people in this community. So at times I find it intimidating to ask questions or find answers to some of the most seemingly simple questions. So you are NOT alone.

As a co-owner of the docs along with @RaananW and the rest of the core dev team, I just want you to know that you are not alone and your perspective is something we care about deeply and are working hard to help address.

I’m going to do the terribly annoying marketing thing here and tell you that @sebavan is exploring a prototype of a new tool that is aimed directly at helping with this very issue. We want EVERYONE to find the answers they need as simply and quickly as they can, no matter how “simple” or “complex” the question.

So I humbly apologize for the tease, but keep your eyes posted on the forum over the next couple weeks. :wink:

And once again, thank you for sharing your feedback and welcome to the family!


@PirateJC - thanks for the quick response! Not sure exactly what the new tool by @sebavan will provide, but perhaps it will scan a chunk of the codebase for usage examples of various items (esp. those that do not have explicitly prepared samples, and that would be groovy. (If not, perhaps this suggestion can find its way to the tool-writer!)

Also, I guess I should clarify that I’m not a “newbie” in the general sense, but certainly with BablyonJS! I’ve actually programmed for quite a long time (I’m getting old!) and have over 10 years experience with 3D/game programming, having shipped a bunch of titles for Xbox, Playstation, etc. I point this out not to boast (although that’s fun!), but for these two reasons:

  1. When I came across your BabylonJS framework, I was blown away by how good of a job you guys did with it. I actually hadn’t even thought it possible to write such a strong engine targeting web browsers and implemented in javascript of all things! My highest regards for your team and I hope you guys keep it coming! :smiley:

  2. I figure it’s a good idea to describe our backgrounds in the chance that it could be useful to others in the forum, etc. (Perhaps there’s provision for this in your user profiles somewhere?)

Thanks again for the response. I plan on getting much more familiar with BabylonJS over the next several months, and I look forward to meeting a new bunch of cool coders!


Awesome! I agree, sharing our experience helps others understand our perspectives and creates a frame of reference for those perspectives.

Super pumped to have you join the Babylon family and thanks so much for the kind words about the engine. We certainly are trying our best to make one of the most powerful and capable web rendering engines out there.

More to come soon on the developer tool :wink:

Just a quick follow up. I’ve since found the “Search the Playground” utility, which basically does what I was looking for. I’m not sure of everything that gets searched, nor exactly what falls under the “playground” realm, though it appears to be pretty extensive. Do you know if this covers all of the available documentation?

It searches all and every playground that anybody has created.