I am jerry rigging a system for my enemy to pathfind in a top down twin stick shooter. I just need to know why this code is not returning the value of the rotation seen in the inspector. RotateRay is a Transform with a child gameobject attached to it.
RaycastHit2D rotatingRayHit = Physics2D.Raycast(RotateRay.transform.position, Vector2.right, 5, layerMaskWalls);
Debug.DrawRay(RotateRay.transform.position, RotateRay.transform.right * 5, Color.green);
RotateRay.Rotate(new Vector3(0, 0 , 1) * 100 * Time.deltaTime);
Debug.Log(RotateRay.transform.rotation.z);