Get mesh from GLTF scene #13550
-
Hi, I'm working on a collision system for a game I'm working on, where the map is loaded in from a GLTF file, however, my collision system uses the Mesh datatype - is there anyway to convert between the two? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
When you load a glTF through spawning SceneBundle it will create an hierarchy of entities, and somewhere in there will be an entity with a Handle of the mesh that you want to use for collisions. To get an idea of what the hierarchy looks like so you can make the correct query, I'd recommend looking at it with https://github.com/jakobhellermann/bevy-inspector-egui?tab=readme-ov-file#worldinspectorplugin |
Beta Was this translation helpful? Give feedback.
When you load a glTF through spawning SceneBundle it will create an hierarchy of entities, and somewhere in there will be an entity with a Handle of the mesh that you want to use for collisions.
To get an idea of what the hierarchy looks like so you can make the correct query, I'd recommend looking at it with https://github.com/jakobhellermann/bevy-inspector-egui?tab=readme-ov-file#worldinspectorplugin