# GameObjects won't collide

**URL:** https://discussions.unity.com/t/gameobjects-wont-collide/665188
**Category:** 2D
**Tags:** 2D
**Created:** [May 19, 2017, 3:43pm UTC](https://discussions.unity.com/t/gameobjects-wont-collide/665188 "2017-05-19T15:43:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Layneee](https://avatars.discourse-cdn.com/v4/letter/l/a698b9/32.png) [@Layneee](https://discussions.unity.com/u/Layneee)
#### Post date: [May 19, 2017, 3:43pm UTC](https://discussions.unity.com/t/gameobjects-wont-collide/665188/1 "2017-05-19T15:43:30Z")

</div>

I’m new to Unity so it’s probably a really easy thing, but i can’t understand why it isn’t working.  
I basically have two Gameobjects, one has a Rigidbody 2d and a Box collider 2D, while the other has only a Box Collider 2D.  
The two objects collide when i run the game, but Unity won’t recognize it.

This is the code i used to see if the two objects collide, and the console is always empty.

> [@](#):
>
> using UnityEngine;  
> using System.Collections;
> 
> public class BGLooper : MonoBehaviour {  
> // Use this for initialization  
> void onTriggerEnter2D(Collider2D collider){  
> Debug.Log("Triggered: " + collider.name);  
> }  
> }

Is there a problem with the code or with something else?  
I already tried a few solutions but i can’t get over this problem:

- the two objects are on the same layer and can collide.
- both objects have the IsTrigger option checked.
- the object with the Rigidbody doesn’t have the ‘isKinematic’ option checked.

---

<div class="post-metadata">

### Author: ![DanielQuick](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/danielquick/32/223057_2.png) [@DanielQuick](https://discussions.unity.com/u/DanielQuick)
#### Post date: [May 19, 2017, 3:52pm UTC](https://discussions.unity.com/t/gameobjects-wont-collide/665188/2 "2017-05-19T15:52:19Z")

</div>

You want:

```auto
void OnTriggerEnter2D(Collider2D collider) {

```

not

```auto
void onTriggerEnter2D(Collider2D collider) {

```

Capitalization is important.

---

<div class="post-metadata">

### Author: ![Layneee](https://avatars.discourse-cdn.com/v4/letter/l/a698b9/32.png) [@Layneee](https://discussions.unity.com/u/Layneee)
#### Post date: [May 19, 2017, 4:01pm UTC](https://discussions.unity.com/t/gameobjects-wont-collide/665188/3 "2017-05-19T16:01:36Z")

</div>

> [@DanielQuick](#):
>
> You want:
> 
> ```auto
> void OnTriggerEnter2D(Collider2D collider) {
> 
> ```
> 
> not
> 
> ```auto
> void onTriggerEnter2D(Collider2D collider) {
> 
> ```
> 
> Capitalization is important.

Thank you man!
