Here is the code from my Project:
I have the problem that I would like to be able to climb with two hands. For this I created a class for the Character, one for the MotionController and one for the SkeletalMesh. As you can see in my repository.
In the character class I spawn two MotionControllers and set the tracking source.
In the code from MotionController I then spawn a SkeletalMesh as soon as it is spawned. I intentionally do not assign this to the MotionController. This is because of a later thing I want to implement.
The main problem now is in SKeletalMeshHand.cpp. There I set in the function void ASkeletalMeshHand::SetLocationAndRotationOfRootScene the location of the hand to that of the MotionController. When this code is active, the following happens:
Now when I access with the left hand and pull up. Everything works great. If I grab with the right hand and pull myself up, there is an offset between the MotionController and the SkeletalMesh of the left hand.
I don’t understand why though?
The white cube is the MotionController. The SkeletalMeshHands transform is set to the transform from the MotiuonController each frame. When I grab, set location wil be no longer set, so that the hand remains in the place where it was grasped