Looking on the documentation of 3D collision,
Unity User Manual 2022.3(LTS)/Physics/Built-in 3D Physics/Collision/Introduction to collision
It is said that i can use compound colliders and that i should put the RigidBody
on the root GameObject
in the hierarchy, and so i created an enemy with a RigidBody
on on the root GameObject
in the hierarchy and a child GameObject
with a BoxCollider
for the body and another child GameObject
with a BoxCollider
for the head
But when i do a physics query like Physics.OverlapSphere
, Physics.SphereCast
or OnTriggerEnter
all colliders are returned, is there a way to do a physics query that with compound colliders they all act as one collision?