I’m working on adding an avatar in the scene and moving it onclick. I have added the avatar and animation separately (as it is needed) and used this example as a reference: https://playground.babylonjs.com/#14GLAR#4
When I click on “Move” button, I get -
Error: Cannot read properties of undefined (reading ‘getRestPose’) and the functionality fails.
In default condition, animations are working fine.
Hi @carolhmj! You can now see my avatar on PG. I have tried using Github to access the animation file that I’m using locally on my laptop. The error is appearing when I try to execute the ‘moveAvatar’ functionality.
the “Armature” node is named “Armature.001” in the 2nd avatar:
I used “Armature” instead of “Armature.001” when searching for children in the PG below but a better fix would be to correct the naming in the DCC tool. Also, you should pass avatarMesh and not armatureMesh to copy() otherwise “Armature” will not be found when searching for children (destMesh.parent does not go high enough in the hierarchy if destMesh==armatureMesh)
the 3rd anim is a morph target animation, not a rigged animation. You should skip it in the copy() function.