Hi guys,
In my game the player can tear its own arm and use a broken arm. it is a skeletal mesh that can be grabbed with the non broken hand and the user still controls its hand.
The broken hand mesh has 2 physics rigid bodies, one for the hand and one for the forearm as you can see :
What I want to achieve is that when the broken hand grab some kind of object, instead of my usual grip system that would attach the object to the hand, I would like the hand to stick on the object and have the forearm have its physics simulated so it has gravity and hangs
I tried to use the following code to achieve this, without success :
SkeletalMesh->SetSimulatePhysics(false);
FBodyInstance* HandPhysicsBody = SkeletalMesh->GetBodyInstance(FName("P_R_Hand"));
check(HandPhysicsBody);
HandPhysicsBody->SetInstanceSimulatePhysics(false);//i guess this is superfluous
FBodyInstance* ForearmPhysicsBody = SkeletalMesh->GetBodyInstance(FName("P_R_Forearm"));
check(ForearmPhysicsBody);
ForearmPhysicsBody->SetInstanceSimulatePhysics(true);
The problem is that the arm in its entirety is falling down.
I guess this is because of the physics hierarchy, the forearm being the parent of the hand.
Is there a way to have the hand stay where it is and have the forearm go down with gravity ?
In the end the problem is similar to a nunchak that could be hold by either end and have the other end be simulating physics regardless of which end is parent