Normal angle on the floor is not 0

Hi,

I would like to know why my Raycast return values from 50 to 80 when I’m raycasting with this method :

private bool IsSliding
    {
        get
        {
            if(IsGrounded() && Physics.Raycast(transform.position, Vector3.down, out RaycastHit slopeHit, 7.5f))
            {
               
                hitPointNormal = slopeHit.normal;
                return Vector3.Angle(hitPointNormal, Vector3.up) > GetComponent<CharacterController>().slopeLimit;
            }
            else
            {
                return false;
            }
        }
    }

I placed a character controller and a box collider that is trigger-cheked.

For the floor, right now, I have a stretched cube as a test zone. (I tried with a terrain also, with no floor elevation and the results are the same)
So, when I’m trying to make my character slides on slopes, he slides on every parts of the map except the slopes (from little to high) because he detected the angle of the slope normally. (Like a 10 angle slope is detected at 10 angle)

Here is the code when the character needs to be moved on slides :

if (IsSliding)
        {
            Debug.Log("IsSliding");
            controller.Move(new Vector3(hitPointNormal.x, -hitPointNormal.y, hitPointNormal.z) * slopeSpeed);
        }

thanks.

Use debug.Log to see the angle in real time.
I will say it is a bug, can you provide more info (The inspector of the CharacterController or more code, a screenshot of the scene)

I use debug.Log to find out that the angles that are returned when it’s flat are between 50 to 80. But when I’m on a slide it’s normal. All my calculations are up there.

I also draw a ray to see if it’s touching the floor, and it is.

This seams like a bug.
Go to the issue tracker.