How to make child-collider fire parent's OnTrigger() script?

I've got a game with a floor that is really just a stretched-out cube. So it's created as a primative cube with scale of 10, 0.1, 10 (creating a 10x10 floor, 0.1 thick) -- so far, so good. For reference, my `Start()` routine has this:

transform.localScale = Vector3(GameValuesScript.baseWidth, GameValuesScript.baseThickness, GameValuesScript.baseDepth);
inverseScale = Vector3(1.0 / GameValuesScript.baseWidth, 1.0 / GameValuesScript.baseThickness, 1.0 / GameValuesScript.baseDepth);

You'll see why in a minute.

My floor's script has an `OnTriggerEnter()` routine that, on a collision, adds a new box where the collision happened (imagine throwing mud-blobs that stick to the wall, except it's the floor), vis:

var addBlox : GameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
addBlox.transform.parent = this.transform;
addBlox.transform.position = Vector3(xx, yy, zz);
addBlox.transform.localScale = inverseScale;  // back to unit-cube.
addBlox.GetComponent(BoxCollider).isTrigger = true; // added on EDIT

What I'd like to happen is: when something collides with this new block (addBlox), the same `OnTriggerEnter()` routine in the parent script is called. That's not currently happening.

What piece of the puzzle am I missing? Does my newly added cube need its own script to forward messages up? Or is there some handy-dandy way to treat everything as one big object with the one 'OnTriggerEnter()`?


Yes, you will need to forward the OnTriggerEnter messages upwards. For Collision events this gets done automatically, for OnTrigger events it doesn't.