Problem getting information out of colliding objects

Hello,
I have a scene where there are many objects of different size. The plays runs around bumping into them. I need a different reaction if the objects are larger or smaller. Calculating their size and player’s size is no problem, I tested and saw they all have a different value. but when I get to the collision test, I get stuck on the same piece of data from some object, and it is not re-checking the data for all objects.

This is my collision code:

function OnCollisionEnter(hit : Collision)
{
if(hit.gameObject.tag == "object")
	{
		var colliderSize = hit.gameObject.GetComponent(ObjectControl).objectSize;

		
		if (colliderSize < playerSize)
			{
			Destroy(hit.gameObject); // if object is bigger, change here to push the player or some type of feedback + sound
			playerSize +=1;
			print("Yummy! I ate a " + colliderSize+ " and my size is now: " + playerSize);
			}

		else
			{
			Destroy(hit.gameObject); // if object is bigger, change here to push the player or some type of feedback + sound
			playerSize -=1;
			print("I've been hit! " + colliderSize + " by a " + colliderSize);
			}
	
}
}

This is the bit of code from each object. They change colour depending if they are smaller or larger than the player’s current size:

static var objectSize = 1.0;
var swapMat : Material;
var originalMat : Material;

function Update () 
{
	var Player = gameObject.Find("player");
	var PlayerSize = Player.GetComponent(PlayerInteractions).playerSize;
	
	objectSize =  (transform.localScale.x);
	
	if (objectSize > PlayerSize) //object is larger than player
	{
	// paint object red
	renderer.material = swapMat;

	}
	
	if (PlayerSize > objectSize ) //if smaller than player 
	{
	//paint object green
	renderer.material = originalMat;

	}
	

}

You should remove static from the objectSize declaration: a static variable is unique, no matter how many instances of the script where it’s declared exist - and you must have an independent objectSize variable in each object’s script. Being static, each object will modify its value in Update, and only God knows which size the player will see when colliding to an object.

Another suggestion: find the player only once at Start - Find is a slow operation, and may reduce the framerate:

var objectSize = 1.0; // <- remove the static keyword
var swapMat : Material;
var originalMat : Material;
private var Player : GameObject; // make Player a non-temporary variable

function Start (){ // find the player only once at Start
    Player = gameObject.Find("player");
}

function Update (){
    var PlayerSize = Player.GetComponent(PlayerInteractions).playerSize;
    objectSize = transform.localScale.x;
    ...