Raycast in facing direction

i want to do ray-cast it facing direction i have
40690-captjjure.png

now i have to rotate the cube by 35 degree when i do that it still face same direction

40691-captkkjhytdsure.png

i have given origin as tranform.position and direction =vec3,-rit

try this

RaycastHit hit;
if(Physics.Raycast(transform.position,transform.TransformDirection(Vector3.forward), out hit))
{

}