.babylon file Format - Attach Action to Scene

Hi,
the “global structure” of the .baylon file format has a top level “actions” property.

How do I add an Action to a Scene so that it is exported to the top level “actions” array. (I’m not refering to actions of e.g. a mesh )

Frank

The global “actions” property in a .babylon file comes from the serialization of scene.actionManager (if defined).

So, you must set a value to scene.actionManager and register actions with it to populate the global “actions” property.

Just for fun, I asked ChatGPT:

The answer is the right one, except it is missing scene.actionManager = new BABYLON.ActionManager(scene); in the code example!

2 Likes