When the object collides with my player I would like to assign that object to a variable. For some reason my script wont work. They collided but the object is not assigned to current weapon.
var currentWeapon : GameObject;
function OnCollisionEnter(collided : Collision){
if(Input.GetKey(KeyCode.Space) && collided.gameObject.tag == "weapon"){
currentWeapon = collided.gameObject;
}
}