Attach another object to a bone #3430
Unanswered
bandinopla
asked this question in
Q&A
Replies: 1 comment
-
In case someone is looking for this, in the end the way I did it was on a useEffect hook: const { scene, animations } = useGLTF('/dude.glb')
const clone = React.useMemo(() => SkeletonUtils.clone(scene), [scene])
const { nodes, materials } = useGraph(clone) as GLTFResult
const { scene: coffeCupScene } = useGLTF('/coffecup.glb')
...
useEffect(() => {
if (nodes && coffeCupScene)
{
nodes.handBone.add(coffeCupScene)
}
}, [nodes, coffeCupScene]); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is the right way to append an object as a child of a bone?
I have loaded a model using the useGLTF hook, see it on screen, all good. The I load another static one, see it on screen all good. How can i make the 2nd object a child of some bone in the first object?
Tried doing it on a useEffect hook but the object just dissapears. Any idea?
Also this doesn't work(?) the object CupModel just dissapears...
Beta Was this translation helpful? Give feedback.
All reactions