Closed JacobOsense2223 closed 7 months ago
When importing the gltf, you get an outline of the entire scene. You can use that outline to map out each child and wrap them within a RigidBody.
const Component = () => {
const gltf = useGLTF('/something.gltf')
return <>
{Object.values(gltf.nodes).map(node => <RigidBody>{node}</RigidBody>)}
</>
}
In this example I have tagged each object in Blender with userData
which allows me to import it and transform each object separately, with unique settings.
How can I dynamically generate RigidBody for specific sub-objects of a glTF model?