Tag Collision Problem

var Power : float  = 50.0;
var canwalk = true;
var jumpPower =4;
var jumpdistance : float = 5.5;
var speed : float = 5.0;
var other : Transform;
var Dodgespeed : float = 20.0;

function OnCollisionEnter(collision : Collision){
  if(collision.gameObject.tag == "wall"){ 
    canwalk = false;
    if(Input.GetButtonDown("Jump") && canwalk == false){
      rigidbody.AddForce(Vector3(-Power,0,0));
    }
    else{
      canwalk = true;
    }
  }								
  if(collision.gameObject.tag== "solid"){         // i made tag call wall
    other.transform = gameObject.transform;    //this is an error and doesnt work  //an error read Only
  }
}

function Update(){
  if(Input.GetButtonDown("Jump") && canwalk == true){
    if (Mathf.Abs((other.position - transform.position).y) < jumpdistance){
      rigidbody.AddForce(Vector3.up*jumpPower);
    }
  }
  if(Input.GetKey("w")){
    transform.Translate(Vector3.forward*speed*Time.deltaTime);
  }
  if(Input.GetKey("s")){
    transform.Translate(-Vector3.forward*speed*Time.deltaTime);
  }
  if(Input.GetKey("a")){
    transform.Translate(Vector3.left*speed*Time.deltaTime);
  }
  if(Input.GetKey("d")){
    transform.Translate(Vector3.right*speed*Time.deltaTime);
  }
  if(Input.GetKey("a")&& Input.GetButton("Jump")){
    rigidbody.AddForce(Vector3(Dodgespeed,0,0));
  }
}

function OnCollisionExit(collisionInfo : Collision) { 
  if(collisionInfo.gameObject == "solid"){      //an error read Only
    other.transform ="";	//an error read Only
  }
}

this is my code The Collision Doesn’t Work And The AddForce Of The Input A+Jump

note:
Please Don’t Say Anything about me i know that iam Beginner

Well, this code has a lot of problems! The ReadOnly error happens because you’re trying to assign something to a transform property - and this property is ReadOnly. Since other is a Transform variable, you should just assign the object’s transform to it:

other = gameObject.transform;

or simply:

other = transform;

And you can’t assign a String (even an empty one) to a Transform! To assign a null value to other, just do it the most obvious way:

other = null;

But the whole idea seems terribly wrong. You should not use Translate to move a rigidbody - use only AddForce or set directly its rigidbody.velocity. You are also mixing local and world space: AddForce uses world coordinates, while Translate by default uses local direction.

Well, I don’t know what exactly you want to do, but would advice you to change the whole thing. If you just want a character that can walk and jump, delete the rigidbody and add a CharacterController instead, and use the Move example script to control it - you can improve this script and add new features (just remember that you must use OnControllerColliderHit event instead of OnCollisionEnter, case you really need it). But if you definetely need to control a Rigidbody, try the script Rigidbody FPS Walker.