It’s gotta be something with the parent/child relationships:
Nothing fancy here:
GameObject 1:
-Capsule collider with Is Trigger DISABLED. I want physics reactions.
-Rigidbody with Is Kinematic DISABLED. I want physics reactions.
GameObject 2:
-Rigidbody with Is Kinematic DISABLED. I want physics reactions.
ColliderGameObject:
-Capsule collider with Is Trigger DISABLED. I want physics reactions.
-Script
AnotherColliderGameObject:
-Box Collider
(This is mentioned to demonstrate to you that this is a compound physics object.)
(No script desired.)
GameObject 3:
GameObjectContainer:
ModelGameObject:
ModelGameObject:
-Box Collider with Is Trigger DISABLED. I'm not doing anything with triggers.
-Script
Another ModelGameObject:
-Box Collider with Is Trigger DISABLED. I'm not doing anything with triggers.
-Script
A bunch more ModelGameObjects with box colliders but without scripts.
GameObject 1 → GameObject 2 = FAIL. No collision detected. Why!?
GameObject 1 → GameObject 3 = SUCCESS. Collision detected, even though there is only one rigidbody between the two objects, and it isn’t even on the one with the script!
The difference is that GameObject 2 has a rigidbody where as GameObject 3 does not. If I were a betting man, I would have presumed 1 → 2 would have worked over 1 → 3. Hence why I need a second pair of eyes.
Nothing fancy with the script either:
void OnCollisionEnter(Collision collision)
{
Debug.Log("hit it!");
}
Riddle me that, Batman. Thanks.
(Googling is just leading me to a bunch of cases of people not knowing how to use Unity’s physics system. This is some fringe case and I’ve been looking at the same situation for too long.)
"Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached." << I wasn't sure if that meant anywhere in the hierarchy chain or literally side-by-side. After posting the question I ended up working on other on-hit type stuff with compound objects and noticed that the script would work if it was side-by-side with the rigidbody. I guess side-by-side it is! Thanks for being my second pair of eyes.
– ZoopTEKA shame you can't put the scripts on the collider you want to specifically test though, for simplicity's sake. I suppose I will have to dig through the Collision's Collider property to figure out if the right thing was hit.
– ZoopTEK