Hello, i’m trying to attach a weapon to a bone, but it always give an error saying that the node il already parented, tried various things but nothing change, the scheleton lhand has another part attached that is a small cube (don’t know why) i have to use that last part to attach the object or the hand is good as well? this.shield=app.root.findByName("shield"); lhand = this.model.findByName('Bip01 I Mano'); lhand.addChild(this.shield); this.shield.reparent(lhand);
Error: GraphNode is already parented (on addChild line)
Does anyone has a project that i can study as reference?
Why do you call lhand.addChild(this.sheild) and this.sheild.reparent(lhand)? They both do the same thing, except addChild requires you to remove the child from it’s parent first.
Seems i’m not able to figure out what i’m doing wrong, tried different things but nothing works here is my project and the code is inside player.js attached to player entity https://playcanvas.com/editor/scene/396696
if anyone can help is greatly appreciated (PS i have put as comment the lines that i tried without success in initialize and start functions)