Capsule character not colliding with ground

I have a character controller and rigidbody on the capsule, but it goes right through the ground, which is just a box with a collider. I’ve been messing with unity for over a year now and have never had this problem. no errors pop up at all. I’m wondering if i forgot an important step or something?

https://docs.unity3d.com/ScriptReference/GameObject.SetActive.html other.gameobject.setactive(false) setting active to false keeps the game object in the scene, but makes it almost gone, no render, or colliders, or anything like that, and variable's set in scripts like maybe HP for example stay the same, unlike gameobject.destroy, witch removes it from the scene completely.

1 Answer

1

You cannot use character controller and rigidbody together. If you are using a character controller than all the physics related activities are by default in that. Adding a rigidbody will conflict the calculations.
Remove the rigidbody and then try…

When i remove the rigidbody, gravity no longer effects my character.

also, when i remove the character controller, the rigidbody still doesn't collide with anything.

Can you post some code here of how you are detecting collision.. Because after removing rigidbody or charactercontroller everything seems ok..

i don't have any code. usually i throw it on and it works fine.

Take a look at the documentation https://docs.unity3d.com/ScriptReference/MonoBehaviour.StartCoroutine.html The second argument of StartCoroutine using a string will be passed to the actual coroutine method. Today, it's highly advised to use the following way to start a coroutine. StartCoroutine(Respawn(5f));