- Home /
ControllerColliderHit.normal is different when hit.gameObect scale is bigger. why?
i called CheckMaxSlope In OnControllerColliderHit like below.
private void OnControllerColliderHit(ControllerColliderHit hit)
{
CheckMaxSlope(hit);
}
private void CheckMaxSlope(ControllerColliderHit hit)
{
float slopeAngle = Vector3.Angle(hit.normal, Vector3.up);
Debug.Log("### slopeAngle " + slopeAngle + "/" + hit.gameObject.name + "/" + hit.normal);
}
and it printed below logs.
slopeAngle 65.00104/Cube (1)/(0.9, 0.4, 0.0)
but it is changed when i change the y scale of the slope to 1000 or bigger.
slopeAngle 65.002/Cube (1)/(0.9, 0.4, 0.0)
slopeAngle 71.44532/Cube (1)/(0.9, 0.3, 0.0)
slopeAngle 56.39288/Cube (1)/(0.8, 0.6, 0.0)
slopeAngle 73.55609/Cube (1)/(1.0, 0.3, 0.0)
slopeAngle 136.0343/Cube (1)/(0.7, -0.7, 0.0)
....why this happened? (the characterController is colide with only one slope)
Your answer
Follow this Question
Related Questions
OnControllerColliderHit won't trigger if not moving 2 Answers
How to detect if characterController is facing a wall? 1 Answer
How to stop CharacterController during Collider's moving? 0 Answers
How do you get an event to call when too Character Controllers hit. 1 Answer
Any reason why OnControllerColliderHit has a NaN normal? 2 Answers