Hello, I have an empty gameobject and a script attached to it in which I create some boxes with the function CreatePrimitive to create a membrane with multiple boxes. The boxes are NOT a child of the empty gameobject. I need a way to detect a collision on one of these boxes in the same previous script. Thank you
I think i resolve by myself. For who is interesting: create a variable bool in the main script (where is the CreatePrimitive) and attach to the boxes created another script where you change the same bool variable in true or false in OnCollisionStay and OnCollisionExit respectively. With GetComponent in the main script, you can read if the bool variable is true or false.