I was trying to load a sword in the right hand but I don’t see the sword. Please see my code below. Could you shed some lights on this please?
fbxloader.load('models/fbx/guard/vanguard_t_choonyung.fbx', (fbx) => {
actions = {};
fbx.scale.set(0.01, 0.01, 0.01)
fbx.position.set(0, 0, 0)
guardMixer = new THREE.AnimationMixer(fbx)
actions['default'] = guardMixer.clipAction(
fbx.animations[0]
)
fbx.traverse(function (object) {
if (object.isMesh) object.castShadow = true;
});
model = fbx;
model.rotation.y = 3;
skeleton = new THREE.SkeletonHelper(model);
skeleton.visible = false;
scene.add(skeleton);
dirLight.target = model;
fbxloader.load('models/fbx/guard/animations/Standing Idle.fbx', (fbx) => {
actions['idle'] = guardMixer.clipAction(
fbx.animations[0]
)
currentAction = 'idle';
activatedActions.push(currentAction);
actions['idle'].play();
fbxloader.load('models/fbx/guard/animations/Great Sword Walk.fbx', (fbx) => {
actions['walk'] = guardMixer.clipAction(
fbx.animations[0]
)
scene.add(model);
guardReady = true;
})
})
fbxloader.load("assets/weapons/fbx/sword/Scottish_Sword.FBX", function (fbxSword) {
scene.add(fbxSword);
fbxSword.scale.setScalar(0.015);
const rightHand = fbx.getObjectByName("mixamorigRightHand");
rightHand.add( fbxSword );
})
})