How to "rotate" a vector?

Hi. I’m making a isometric low-poly game. My camera is rotated by 45 degrees. If I use a raycast from camera to cursor and place cursor above the player it gives me vector (-0.7, 0, 0.7) because camera is rotated, so my top means top-left. I need to make this vector (0, 0, 1), is there a way of doing this? (It should work in all directions). Thanks!

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
 
 RaycastHit hitInfo;
 
 if (Physics.Raycast(ray, out hitInfo, Mathf.Infinity, mouseRayMask))
 {
     Debug.Log((hitInfo.point - transform.position).normalized);
 }

Ok, i got this :slight_smile:

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
 
RaycastHit hitInfo;
 
if (Physics.Raycast(ray, out hitInfo, Mathf.Infinity, mouseRayMask))
{
    Debug.Log(Quaternion.Euler(new Vector3(0, 45, 0)) * (hitInfo.point - anim.transform.position).normalized);
}