How to access variables from another script on collision ?

Hi all! I`m making a game with spots and ai; bots have a script “Aibot” with a int variable “botNumber”, and spots have script “Spot” with variable “botOnSpot”. So i just need to know what number of bot is staying in the radius of collision of a spot. So how can i equate this two variables on collision? I tried to use gameObject.SendMessage, but this doesnt help. Thanks!

Found information at http://docs.unity3d.com/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html .

This is my solution :slight_smile:

void OnCollisionEnter(Collision collision)
{
    myName = collision.gameObject.GetComponent<ScriptName>().name;     
}