Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity raycast hit child object

Colliders on child objects are treated as though they are additions to the parent collider 
(this is what you want for most physics tasks). However, the RaycastHit object also has a field 
for the collider that was hit. The reported transform is the parent's transform but the 
collider is the exact collider that was hit. If you need the transform of the child object, you 
can use the collider's transform property, etc.
Source by forum.unity.com #
 
PREVIOUS NEXT
Tagged: #unity #raycast #hit #child #object
ADD COMMENT
Topic
Name
6+1 =