# Compressed Interactive Unity GLTF Content

**URL:** <https://forum.babylonjs.com/t/compressed-interactive-unity-gltf-content/50105>\
**Category:** Demos and projects\
**Created:** [April 29, 2024, 5:00am UTC](https://forum.babylonjs.com/t/compressed-interactive-unity-gltf-content/50105 "2024-04-29T05:00:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [April 29, 2024, 5:00am UTC](https://forum.babylonjs.com/t/compressed-interactive-unity-gltf-content/50105/1 "2024-04-29T05:00:13Z")

</div>

[Compressed Interactive Unity GLTF Demo](https://playground.babylonjs.com/index.html?BabylonToolkit#V9AUOR)

> **[Babylon.js Playground](https://playground.babylonjs.com/index.html?BabylonToolkit#V9AUOR)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

This is a playground demonstrating the **Babylon Toolkit** support for generating compressed  
**Interactive Unity GLTF Scene Files**

What makes the exported content **interactive** are the **script components** and game object setup like **zero code physics configuration**. You get all this by simply loading the **Interactive Unity GLTF Scene File** using any one the BabylonJS Scene Loaders or Asset Manager (And the babylon.toolkit.js runtime library is loaded of course).

What makes the exported content compressed is the **webp** compressed textures except for specialty maps like lightmaps, heightmaps and splatmaps which must remain lossless **png** to maintain pixel precision and **hdr** lighting.

The entire scene payload (json and bin) was compressed using the built in toolkit support for generating **gzipped** compressed scene files ( **.gz.gltf** and **.gz.glb** and **.gz.bin** )

Loading compressed scene files:

```auto
// This loads the sample scene & player armature exported from a unity starter assets project
// https://assetstore.unity.com/packages/essentials/starter-assets-character-controllers-urp-267961
const assetsManager:BABYLON.AssetsManager = new BABYLON.AssetsManager(scene);
assetsManager.addMeshTask("samplescene", null, UNITY.SceneManager.PlaygroundRepo, "samplescene.gz.gltf");
assetsManager.addMeshTask("playerarmature", null, UNITY.SceneManager.PlaygroundRepo, "playerarmature.gz.gltf");

```

These two **Interactive Unity GLTF Scene Files** provide the core functionality of the [Unity Third Person Player Controller Starter Asset](https://assetstore.unity.com/packages/essentials/starter-assets-character-controllers-urp-267961) exported by the toolkit to the native BabylonJS environment

> **[Starter Assets: Character Controllers | URP | Essentials | Unity Asset Store](https://assetstore.unity.com/packages/essentials/starter-assets-character-controllers-urp-267961)**
>
> Get the Starter Assets: Character Controllers | URP package from Unity Technologies and speed up your game development process. Find this & other Essentials options on the Unity Asset Store.

[![](https://img.youtube.com/vi/4QuPlKzdq14/maxresdefault.jpg "Starter Assets overview | Unity") ](https://www.youtube.com/watch?v=4QuPlKzdq14)

[Compressed Interactive Unity GLTF Demo](https://playground.babylonjs.com/index.html?BabylonToolkit#V9AUOR)

---

<div class="post-metadata">

**Author:** ![jabulanikid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jabulanikid/32/36013_2.png) [@jabulanikid](https://forum.babylonjs.com/u/jabulanikid)\
**Post date:** [May 10, 2024, 2:15am UTC](https://forum.babylonjs.com/t/compressed-interactive-unity-gltf-content/50105/2 "2024-05-10T02:15:54Z")

</div>

This is Amazing. It’s a little bit over my head but this is like that!!! I like how the unity physics are imported to Babylon.JS. Does this mean any kind of unity programmed physics can be ported to babylon? such as unity asset physics?

---

<div class="post-metadata">

**Author:** ![MackeyK24](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mackeyk24/32/3741_2.png) [@MackeyK24](https://forum.babylonjs.com/u/MackeyK24)\
**Post date:** [June 12, 2024, 7:27pm UTC](https://forum.babylonjs.com/t/compressed-interactive-unity-gltf-content/50105/3 "2024-06-12T19:27:59Z")

</div>

Pretty much… All Unity collider types and the rigid body components are supported for export. At runtime any programmed physics interactions can be ported as well. Pretty much all physics engines have some sort of API you use to interact with bodies… like AddForce, AddImpulse or directly setting the linear and angular velocities… updating properties like mass, inertia etc…
