How can I check if an instantiated object collides with another instantiated object?

In my script I instantiate a game object (player) ,and another one (coin) ,and I want to see if that game object collides with that coin but i don’t know how to do that.

Firstly, both game objects MUST have a Collider or Collider2D. Then, one of them must have a script with the method OnCollisionEnter or OnCollisionEnter2D, in this method you can write what you want to happen.

If you do not want then to actually collide, you can check “Is Trigger” on the Collider Component and use the method OnTriggerEnter.

Hope it helps