what is the problem of my raycast object finder script?

hello
I write this code for finding my objects and put them in variable to move them but I my code can’t find any object in his sides

   var up = transform.TransformDirection(Vector3.up);
   var right = transform.TransformDirection(Vector3.right);
//====================================================|
   var hit_up : RaycastHit;
   var hit_down : RaycastHit;
   var hit_right : RaycastHit;
   var hit_left : RaycastHit;
//====================================================| 
   var UpObject : GameObject;
   var DownObject : GameObject;
   var RightObject : GameObject;
   var LeftObject : GameObject;
//====================================================|

function Update () {
//UP
	
	Debug.DrawRay(transform.position, Vector3.up * 0.25 , Color.blue);
	Debug.DrawRay(transform.position, -Vector3.up * 0.25 , Color.green);
	Debug.DrawRay(transform.position, Vector3.right * 0.25 , Color.gray);
	Debug.DrawRay(transform.position, -Vector3.right * 0.25, Color.grey);
	
	if(Physics.Raycast(transform.position, -up, hit_up, 0.3)){
	 UpObject = hit_up.collider.gameObject;
	 Debug.Log("up");
	 } 
//Down
	if(Physics.Raycast(transform.position, up, hit_down,0.3)){
	Debug.Log("down");
	DownObject = hit_down.collider.gameObject;
	}	
//Right
    if(Physics.Raycast(transform.position, right, hit_right,0.32)){
    RightObject = hit_right.collider.gameObject;
    Debug.Log("right");
    }
//Left
	if(Physics.Raycast(transform.position, -right, hit_left,0.32)){
	LeftObject = hit_left.collider.gameObject;
	Debug.Log("left");
	}
	
}

thanks

the problem is in my two first line’s
they should go in Update function:

function Update () {

	var up = transform.TransformDirection(Vector3.up);
    var right = transform.TransformDirection(Vector3.right);
    
.
.
.