Switching from isKinematic using a ragdoll. Ragdoll does not receive impact.
Hello,
Currently I'm using a ragdoll where all children are set to isKinematic. I have a physical projectile impact the object and set the ragdoll components to isKinematic==false.
The projectile moves to fast to give the rigidbodies the impact that occurred when switching to isKinematic==false;
What is the best way to store the impact point, impact force direction, and impact force so I can recreate the collision the next frame after isKinematic is false.
Please let me know if you need any information I forgot. Thanks in advance!
Answer by The-Arc-Games · Jun 29, 2016 at 11:47 AM
The most common way to achieve this is to use a RAYCAST. Searching for "projectile raycast" should put you on the right track, whereas you -predict- where the projectile will be (or was) and use its physical characteristics to perform the desired impact.
I'm currently using https://docs.unity3d.com/ScriptReference/Collision-impulse.html to "store" the collision when the collision occurs, I then (in that frame) change the rigidbody to is$$anonymous$$inematic(false). Then using LateUpdate I apply the impact using a simple AddForce(sortedImpulse)
It works 99% of the time but some impacts get lost.
I was worried trying raycasts off of every projectile would be costworthy as I need to keep this over 90FPS for VR. However, given some recent experiments I'm not so worried about the cost of a raycast messing with things to much.
I'll certainly give this idea a try and see if I can get that 99 - 100% Thank you @The Arc Games