Hello,
I’m currently making a climbing system from scratch and am having some problems with the raycasts. I have two raycasts shooting diagonally from a bit up and to the front of my character. My problem is that when I rotate my character the raycast origin point ‘z’ coordinate stays the same.
I have tried the transform.TransformDirection method and it actually gets worse. The only solution I could think of right now was to create an empty gameObject and child it to the character and getting its position through the inspector, but there’s got to be a way…
The raycasts are the blue lines in the images, I also have a link to a gif so you can understand clearly what the problem is.
Debug.DrawRay(transform.position + Vector3.up * 1f + Vector3.forward * .3f, transform.TransformDirection(new Vector3(1f, -1.5f, 0)) * 1.5f, Color.blue);
Debug.DrawRay(transform.position + Vector3.up * 1f + Vector3.forward * .3f, transform.TransformDirection(new Vector3(-1f, -1.5f, 0)) * 1.5f, Color.blue);
