How to specify two game objects are in contact in 2D?

I am trying to add physics to a bike object with hindge joints connected to wheels now i need to add force on back wheel when i press up button this should happen only when bike is in contact with floor. How to acheive this.

OnCollisionEnter is not being called. and i added tags for floors. Is there a way to check if the bike is in contact with floor ?

Couple of methods you can try:

  1. Add a trigger collider beneath the back wheel of the bike and flag when you are on the floor in OnTriggerEnter and reset the flag in OnTriggerExit
  2. Raycast down from the back wheel and see if it hits the floor.