Hay, I'm new to Unity and I'm getting stuck into programming with javascript. I wanted to learn how to see if 2 GameObjects were colliding. So i looked up collisions in the documentation and it turns out there are collisions and colliders.
What's the difference between them?
Also, how would i use them to work out if 2 cubes were colliding? (both cubes are moving towards each other, but when they collide they go through each other).
Colliders are how the Unity detects collisions. When a collision occurs, the methods OnCollisionEnter, OnCollisionExit, and OnCollisionStay on the objects that have colliders will get called as appropriate.
So let's say you have cubes, both of which have a rigidbody and a collider.
If you want your cubes to move through each other, and not hit each other, you will probably want to check "Is Trigger" on the colliders. The physics engine won't then bounce the cubes off each other when the collision occurs. Instead of getting the three messages OnCollisionEnter/OnCollisionExit/OnCollisionStay, you will get OnTriggerEnter/OnTriggerExit/OnTriggerStay.
If you want the cubes to NOT be controlled by physics at all, like gravity, then you will probably want to set "Is Kinematic" on the rigidbodies.