that works fine if i instantiate the component once. But if i instantiate multiple Doors with different width values all get the width value of the last instance… why?
you need to clone the gltf date, both doors refer to the same data model, thats fundamentally how loader hooks work. there’s also a useGraph hook in r3f which gives you nodes/materials back
not 100% sure if clone() will duplicate morphTargets, if not try clone(true). given that clone works each door would now have its own set of morph targets which can be altered separate from the other instances.
@drcmda thanks for providing the solution!
Does this mean that if i instantiate this component 3 times i’ll get 3 scene graphs? Performance wise this would be worse than just scaling it right, because there i am using 3 times the same graph?
i dont know morphtargets well enough but you might be able to re-use the geo + materials, and just use the cloned morph targets on the mesh. this is essentially a threejs problem, maybe someone else can help.