Hi, I'm sorry if this is really simple, but I've struggled with it for several days and can't get it figured out.
I have a character with 2 arms, grabbing a gun.
I have IK targets on the gun, to position each hand/arm on to the gun.
Sometimes I want the back hand to grab a rope.
When the character is off a rope, I want it to use the animations (for where to grab the gun, and aim and such).
What method should I use for this?
Currently I have tried:
- SkeletonData Asset for the main body of the character.
- On that, I added a "Skeleton Utility" script.
- That let me "spawn a hierarchy".
- The back arm IK target bone, I added an override.
- In my player code, when he's grabbing the rope I tried this:
backHandIKGrab.overrideAlpha = 1f;
backHandIKGrab.bone.X = grabPos.x;
backHandIKGrab.bone.Y = grabPos.y;
When he is not supposed to grab the rope (and should follow the animations) I tried this:
backHandIKGrab.overrideAlpha = 0f;
RESULT:
He always just follows the animation, not matter what.
SECOND TRY:
I also tried this for when he is to follow the rope:
backHandIKGrab.overrideAlpha = 1f;
backHandIKGrab.transform.position = grabPos;
RESULT:
But that makes him always grab the rope, and never follow animations, even though I set overrideAlpha to 0f, when he should follow animations.
What am I missing?
Thank you!
-Nathan