I created a bone that is animated along a path in 3ds max.
i have brought it into playcanvas and can see animating. I want to attach a camera and other entites to this bone. I am trying to do this with this script
var CarInit = pc.createScript('carInit');
CarInit.attributes.add('AnimationBone', {
type:'entity'
});
CarInit.attributes.add('Camera', {
type:'entity'
});
CarInit.extend({
initialize: function(){
console.log(this.AnimationBone.findByName("Bone001"));
this.AnimationBone.findByName("Bone001").addChild(this.Camera);
}
});
The issue has when i run it i get
GraphNode is already parented
AnimationBone does not even have any children and camera has no parent