How to cast a Ray using local pivot of an object?

How can I cast a Ray from the position of the object toward the other way of the X local pivot arrow like i show with the green arrow in the screenshot? I want to use the local pivot point because if i rotate the Tile i want the Ray to rotate too.

82332-69e15e676a4b4c34ae68b078602d435a.png

I use this code but the results are not what i want

RaycastHit hit;

if (Physics.Raycast(transform.position, -transform.right, out hit, maxRayDis)) {
				
	Debug.DrawLine (transform.position, -transform.right*maxRayDis, Color.green);
}

82334-785a6a096e934e2d89026ddc726c53f8.png

your raycast is correct, your Debug is wrong. Drawline is a from to while drawray is a from along