- Home /
Performance cost of using character collider?
I am attempting to get an update to this question: https://answers.unity.com/questions/57680/should-a-character-controller-attach-with-rigidbod.html
There are conflicting answers. From my understanding since the character controller uses a collider with no rigidbody attached there will be a performance penalty.
"You should never move a Static Collider on a frame by frame basis. Moving Static Colliders will cause an internal recomputation in PhysX that is quite expensive and which will result in a big drop in performance. On top of that the behaviour of waking up other Rigidbodies based on a Static Collider is undefined, and moving Static Colliders will not apply friction to Rigidbodies that touch it. Instead, Colliders that move should always be Kinematic Rigidbodies."
On the other hand there is another answer that says:
"The character controller (CC) - at least as implemented in PhysX, that is a kinematic CC - is a very specific piece of code working alongside (but outside of) the main physics simulation (rigid body dynamics). Although the CC do use a capsule collider, the collision is typically performed "by hand" in the CC code rather than automatically through the physics simulation like other colliders."
Does anyone have more insight into this?
Answer by Zubzuke · Nov 13, 2020 at 10:21 PM
Read this:
https://answers.unity.com/questions/536674/how-to-detech-collision-without-rigidbody.html
Also this:
https://forum.unity.com/threads/non-static-colliders-without-rigidbody-still-cost-in-unity-5.452177/
Pretty much answers your question I believe.
I do not believe it does, there is still a performance cost to use move static colliders around, but I want to know if character colliders have the same performance cost as static colliders, or as the answer said "working alongside (but outside of) the main physics simulation" which would not incur a cost to move around as it does the static colliders.
At least one of the two colliding objects must have a rigid body, so RBs are always involved.
As for static objects, they are passive and never do anything, they simply await to be hit by something dynamic. You should not move static colliders, that is indeed expensive because many things have to be recomputed.
Dynamic colliders are always more costly, because they are active.
In the thread I mentioned, the Unity guy clearly says: "In general, one is advised to have a RB on all the physics objects that are moved from scripts as otherwise some parts of the world might not get updated properly (example: a ball sleeping on a static box won't always be awaken if you remove the static box; a performance optimisation in the physics engine)."
So just to make sure everything works well, you should use a RB and mark it as kinetic if you update it yourself.
Your answer
![](https://koobas.hobune.stream/wayback/20220613015731im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
add camera collision without CharacterController 1 Answer
Excluding some physics collisions 3 Answers
Weapon passing through colliders (objects)? 0 Answers
How to prevent the character controller sometimes passing through walls? 2 Answers
CharacterController stop the jump near the top of boxes (collider problems?) 0 Answers