chitose

Wasn't sure which subforum to post this in as my problem involves issues with both the editor and Unity.

I'm using IK constraints to keep a character's hands attached to a gun bone. This works as expected initially.


Skeleton hierarchy:


In order for the player to be able to control the aim of the gun dynamically I added another IK constraint affecting the gun bone. When this constraint is applied the gun bone rotates as normal and the IK constraint attachments for the arms also move correctly. However only one of the arms follows its constraint with the other ignoring it. (The head also has an IK constraint attached to the gun bone which continues to work correctly.


I tried recreating the approximate shape of the relevant parts of the skeleton in a new file and encountered the exact same problem. I then tried it again but parented the gun bone to the IK attachments in a different order and this time neither of the arms would follow their constraints.

After this I tried exporting the skeleton to Unity and oddly the problem was not present. Both arms remain attached to the gun when the gun's IK constraint is moved.


However I then encountered an additional problem when flipping the skeleton (through the Skeleton Utility flipX parameter). The gun constraint appears to be positioned correctly but the gun bone faces 180 degrees away from it (with the arms still attached as they should be).


I don't know if these issues are related at all considering that they both affect the same bone but are different in nature. Any suggestions of what the issue might be or possible workarounds would be greatly appreciated.
chitose
  • Postovi: 2

Pharan

Single bone IK is currently buggy when it flips. There are some changes coming to Spine soon that will fix it.

For now though, there's a helpful thread: How to Fix IK Flipping Issues

From the looks of it, basically, you just need to give that bone a "dummy parent bone" at the same position as the bone you want to control via IK so that it's a 2-bone IK instead of one. At least for now.
Avatar
Pharan
  • Postovi: 5366

chitose

Pharan je napisao/la:From the looks of it, basically, you just need to give that bone a "dummy parent bone" at the same position as the bone you want to control via IK so that it's a 2-bone IK instead of one. At least for now.
That fixed the problem. Thanks for the quick response.
chitose
  • Postovi: 2

Pharan

Good luck with your game! :yes:
Avatar
Pharan
  • Postovi: 5366


Natrag na Unity