Quantcast
Channel: Questions in topic: "ragdoll"
Viewing all articles
Browse latest Browse all 565

How can I cast a ray from a ragdolls child bone? And disable the rest

$
0
0
I know you can cast a ray from the rigidbody, but if i am using a ragdoll with a lot of rigidbodies and colliders, how can I choose only one part of the armature, lets say the hips(I mean the hips green collider), to check collision with the ground. But only raycast from this bone and disable all the rest of the raycasts? Like this: ![alt text][1] [1]: /storage/temp/25082-raycast.png I have this script that raycasts to check if the character is grounded void IsGrounded() { RaycastHit hitInfo; if (Physics.Raycast(transform.position + Vector3.up * 0.8f, Vector3.down * 0.5f, out hitInfo, Mathf.Infinity)) { if (hitInfo.distance > 0.1f) // Change .1f to what you need Debug.DrawRay(transform.position + Vector3.up * 5f, Vector3.down * 5f, Color.green); isgrounded = false; if (hitInfo.distance < 0.1f) isgrounded = true; } }

Viewing all articles
Browse latest Browse all 565


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>