- Home /
Question by
scy4008823823 · Apr 09 at 07:43 PM ·
raycasthit
How to use Raycast to detect a 3D child gameObject B(Set in a bigger gameObject A , but only occupy part of the area)
I was developing a function (A 3rd person Aim ray cast) that expects to detect an areal zone.
When my ray cast (From my 3rd character to the center of the screen) detects this I call "2D TerriansContainer" zone, I want the ray to change its color to green while red if I aim the bigger gameObject"Wall". And when I aim at the air zone, I don't want my ray to appear (this already has been done).
the way now I come up with is to expand the inner "2D TerriansContainer" gameObject that the ray can firstly detect it, this could be ok. but I wonder is there a more appropriate way to achieve this function. Thanks.
the struct seems like the pic2.
file.png
(4.0 kB)
bahgxpjs7zr-cb.png
(138.7 kB)
Comment