I have a script that detects a raycast on an animated character
if (Input.GetButtonDown(“Fire1”)||Input.GetKeyDown(“f”))
{
if (Physics.Raycast(transform.position, transform.forward, hit, Mathf.Infinity, mask.value))
{
var parent = hit.collider.transform.root;
var ragdollScriptify : RagdollScriptify = parent.gameObject.GetComponent(RagdollScriptify);
ragdollScriptify.Shot();
}
}
The shot() call enables a ragdoll on the object:
function Shot()
{
anim.enabled=false;
for (var body : Rigidbody in rigidBodies)
{
body.isKinematic = false;
}
}
But after this call, raycast no longer generates any hits - the ragdoll works fine - just no raycast against the collider…
Thanks for any help