Answer the question
In order to leave comments, you need to log in
Problem with BoxColider?
Good afternoon. The problem is this. On the obstacles is a BoxColider, exactly in the center. I wrote a code so that when an obstacle and a character collide, time stops and the "lose" panel is displayed. When I tried to play without this code, everything was fine, the character was not affected by the colliders if he ran past the obstacle. But when I turned it on, at a long distance, the collider somehow hit the character and the game ended.
void OnControllerColliderHit(ControllerColliderHit hit)
{
if (hit.gameObject.tag == "obstacle")
{
losePanel.SetActive(true);
Time.timeScale = 0;
}
}
Answer the question
In order to leave comments, you need to log in
maybe the problem is that the collider on the player itself is very large or just in that place there is a collider without an object
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question