0 votes
asked in General Help by (120 points)

Hi, 

I'm creating an RPG and i've used the AimIK to allow the player to have full control in which direction their looking and in what direction they attack in. But one issue that arises from this feature is that the player can put certain body parts through walls or a sword their holding through a wall. Heres an image to demonstrate the issue:

the image below shows the head going through the walls.

the image below shows the weapon going through the walls. Is there any way i can avoid this sort of thing happening as it looks strange. Thank you :)

1 Answer

0 votes
answered by (16.3k points)
Hey,

Instead of creating some very complex IK solution for this, you could create a compound collider for your character controller. Instead of having just a capsule, add a sphere collider for the head and move it to head position in LateUpdate by script. If the head colliders is a child of the character controller rigidbody and doesn't have a rigidbody of its own, it will work as the character controller's collider. You can do the same with the sword.

Also, check out the "Penetration Avoidance" demo in FIK.

Best,

Pärtel

Welcome to RootMotion Q&A, where you can ask questions and receive answers from the developer of Final IK and PuppetMaster and other members of the community.

Post as a guest, create an account or login via Facebook.

Please use the correct category when you post your questions.

...