What I am trying to achieve is to get a ray to follow the players global? rotation and face the direction the cube is at the moment it points the same direction even when the cube rotates ill show you the script
void Update ()
{
RaycastHit hit = new RaycastHit();
Debug.DrawRay(transform.localPosition, Vector3.right * 10);
if (Physics.Raycast(transform.position, Vector3.right, out hit, 10.0f))
{
Debug.Log(hit.transform.name);
}
}