Hello everybody,
What I’m trying to do is to cast a ray, starting from the “feet” of my FPS-character controller, with a certain angle to the ground .
I want to make a “climbing constraint” using the method where if the casted ray encounters an obstacle ahead, then I can constraint the climbing of the character by tweeking the angle of the ray. I think this is standard procedure for what I aim to do.
However I can’t figure out how to cast a ray using transform.forward and applying it a rotation in order to obtain the direction for my Physics.Raycast .
I have tried using Quaternion and no luck so far. What I’m curently doing is:
Quaternion rotation = Quaternion.Euler(0.0f,0.0f,45.0f);
Debug.DrawRay( collider.bounds.min,rotation * this.transform.forward * 400, Color.red);
I hope I’m not making this too confusing…
Please help and thanks in advance.