0 votes
asked in General Help by (150 points)

Hi, Can we have tutorial for how to Hit Reaction using final IK please.
I tried this steps but there is messing script that I don't have it in demo. (HitReactionCharacter.cs)

1. Have a character ready with FullBodyBipedIK and ragdoll colliders on the bones. 2. Add the HitReaction component to an empty gameobject, fill it in just like in the "Hit Reaction" demo scene. You can actually copy the component from there and just replace the collider and IK references 3. Make a script that raycasts to where you click and calls HitReaction.Hit() just like in the HitReactionCharacter.cs example.
Also, can we make this hit reaction by using projectile not raycast.
Thanks.

1 Answer

0 votes
answered by (22.8k points)
selected by
 
Best answer

Hey,

The script is HitReactionTrigger.cs (you should be able to find it in the demo/package), not HitReactionCharacter, don't know where that mistake came from, sorry. Anyway, HitReactionTrigger.cs has the raycasting code, please look for that.

About using projectiles, you would need to have OnCollisionEnter(Collision collision) in a script and if a collision with the projectile happens, call something like 

hitReaction.Hit(collision.collider, -collision.GetContact(0).normal * collision.impulse.magnitude, collision.GetContact(0).point)'

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.

...