I noticed a problem in Unity's third person controller's ground check.
The ground check should detect whether or not the player is standing on the ground. It does so by sending out a ray beneath the player.
However, if the player stands on top and in middle of two boxes and there is a space between these boxes, then the ray shoots into the gap and the player thinks he is not in contact with the ground, which looks like this:
I am unable to move. You can clearly see that the ray is in the gap and thus the player animator airborne blend tree is active.
What is the best way to solve this problem?
I was thinking of shooting multiple rays, from the same origin but with different angles. And OnGround
should only be true, if X% of these rays hit the "ground". Or is there a better way?
No comments:
Post a Comment