child object not triggering triggers is this possible?

void OnTriggerEnter (Collider other) {

		if (other.gameObject.name == "floor") {
			Debug.Log ("trigger happened");
		}
	}

i have trigger checked on the object that is the trigger. does it matter that the object this code is attached to is a child? i have no clue as to why it does not work as i have got the same with other games i have made and it worked. please help me i am really annoyed by this :frowning:

There are several reasons it might not work:

  1. None of the colliders have the IsTrigger checkmark checked on (has to be at least one)
  2. None of the colliders have a Rigidbody attached to (has to be at least one)
  3. Maybe for the two layers collisions are disabled. Check Edit → Project Settings → Physics
  4. Obvious reasons (name is spelled wrong) → then at least the method should be entered (set an aditional Debug.Log before the if method to check or use Debugger)

Being a child is not the reason

void OnTriggerEnter2D (Collider2D other) {
blah blah blah
}

answer is above