raycasting issue

I have this weird issue where i Raycast from the red square 2 lines with Debug.DrawLine to verify directions. The lines are correct but both casts returns the values of B square for some unknown reason.

here is my code:

if (Physics.Raycast (Vector3(VerifyBlock.transform.position.x,VerifyBlock.transform.position.y,VerifyBlock.transform.position.z), Vector3(VerifyBlock.transform.position.x+100,VerifyBlock.transform.position.y,VerifyBlock.transform.position.z), hitRight, 7))
			{
				Debug.DrawLine (Vector3(VerifyBlock.transform.position.x,VerifyBlock.transform.position.y,VerifyBlock.transform.position.z), Vector3(VerifyBlock.transform.position.x+100,VerifyBlock.transform.position.y,VerifyBlock.transform.position.z), Color.cyan);
				nameRight = hitRight.rigidbody.name;
				textureRight = hitRight.rigidbody.renderer.material.GetTexture("_MainTex");
				gameobjectRight = GameObject.Find(nameRight);
				
				if (VerifyBlock.rigidbody.name == "box_1")
				{	
					print("right texture: " + textureRight + " and right name: " + hitRight.rigidbody.name);
				}
			}

			if (Physics.Raycast (Vector3(VerifyBlock.transform.position.x,VerifyBlock.transform.position.y,VerifyBlock.transform.position.z), Vector3(VerifyBlock.transform.position.x,VerifyBlock.transform.position.y-100,VerifyBlock.transform.position.z), hitDown, 7))
			{
				Debug.DrawLine (Vector3(VerifyBlock.transform.position.x,VerifyBlock.transform.position.y,VerifyBlock.transform.position.z), Vector3(VerifyBlock.transform.position.x,VerifyBlock.transform.position.y-100,VerifyBlock.transform.position.z), Color.blue);
				nameDown = hitDown.rigidbody.name;
				textureDown = hitDown.rigidbody.renderer.material.GetTexture("_MainTex");
				gameobjectDown = GameObject.Find(nameDown);
				
				if (VerifyBlock.rigidbody.name == "box_1")
				{
					print("down texture: " + textureDown + " and down name: " + hitDown.rigidbody.name);
				}
			}

Thanks a lot for the help.

Raycast() cast a Ray. That is a position and a direction. It appears you are using two positions. You can change to using Physics.Linecast(), or you can change your Raycasts to use a direction. Note you are going to a lot of unneeded work with your positions. Your right cast would be:

 if (Physics.Raycast (VerifyBlock.transform.position, Vector3.right, hitRight, 7))

And then for the Debug:

Debug.DrawRay(VerifyBlock.transform.position, Vector3.right * 7);

Note your calculations as well as my code here is using the World right. If the red cube will be rotating and if you want the cube’s right, use transform.right.