Having trouble attaching a weapon to the hand
Posted: Wed Dec 13, 2017 4:41 pm
Hi there, having a issue with attaching my weapon to the hand. I am getting a "No mesh, or mesh not of skinned mesh type" error in log, kind of stumped on it, any help will be appreciated. This is my code and I have narrowed it down to the offender ( I will comment), I have also tried 3 different models to see if it was a problem there and google searches.
Unhandled exception at 0x00007ff66b422e97 in irrliuchtconsolegood.exe: 0xC0000005: Access violation reading location 0x0000000000000000. as well
Code: Select all
scene::IAnimatedMesh* wep_mesh = (scene::IAnimatedMesh*)smgr->getMesh("../../media/AK47_Free/ak_body/aknewlow.obj");
scene::IAnimatedMeshSceneNode* weP = smgr->addAnimatedMeshSceneNode(wep_mesh);
scene::ISkinnedMesh* char_mesh = (scene::ISkinnedMesh*) smgr->getMesh("../../media/Hand/Hand/Hand.obj");
scene::IAnimatedMeshSceneNode* boneS = smgr->addAnimatedMeshSceneNode(char_mesh);
irr::scene::IBoneSceneNode* handZ = boneS->getJointNode("Left_Hand"); //this line here seems to be the problem
handZ->addChild(weP);
handZ->setPosition(core::vector3df(-12.f,2.f,42.f));