I’ve made about 80% of my character controller and i’m tying up loose ends.
PROBLEM:
If moved, the character will continue to move unless a ray hits a wall in front of him. The ray distance is calculated by the collider radius and collider height, and originates from the transform.position and heads in the movement direction.
Moving in an X, Z, and Y position individually (X and Z together) works well, but it’s when I merge the X and the Y that the results are kind of bleh.
WHAT I WANT TO ACCOMPLISH:
Send a ray out from the transform.position. From there, I want to somehow (by the will of God) hit the transforms’ collider. Then I want to take the hit distance and send out a new ray that will check for any collisions within the current movement direction, and get on with my life.
Any suggestions on how to accomplish the desired behavior?
Additional Information:
-
It’s a capsule collider
-
I really don’t want to use OnCollisionEnter()