check which collider collides

im trying to make a hook which can pick up and knock over other objects, the problem is it has both a mesh and a box collider but how do i check if the hook is colliding with its box collider and not with its mesh collider?

Hello Iron,

Well in javascript you could do:

var Item : Transform;

function OnCollisionEnter (hit : Collision){

var boxColl = Item.GetComponent(BoxCollider);

if(hit.collider == boxColl){



The grab function is your code for picking the item up.
if you want to code for that too just ask.

Seems like I had time for this answer today.

This code is just a bit different.

function OnCollisionEnter (hit : Collision){

var boxColl = hit.GetComponent(BoxCollider);

if(hit.collider == boxColl){

Grab(); //or call another script

//Apply this to the object you want to pick up
//I didnt test this 1, please tell me if it works or not.

Don’t forget: don’t just feed the scripts in unity answers, read them, change them, use them, LEARN