A small thing about the Rigidbody component for those who are using 2021.3.13f1

This is a small note on the following course:

For those who are using Unity 2021.3.13f1 like I do, there seems to be an issue when using a Rigidbody with a Character Controller on a parent.

I don’t know when or how it was added, but at this moment, the version 2021.3.13f1 that I uses seems to consider a Character Controller that is parented to a object that has a Rigidbody as one of its sources for collisions.

What that means is that a RigidBody incorporates the collision data of all colliders from its children and parents (unless another Rigidbody component exist on a parent which then cut the parenting link for the collider or unless an object is on a different layer) and it seems like it now incorporate the Character Controller as a non-trigger Capsule collider.

In my case, this resulted in the character bouncing upward as he moves forward and as the movements was updating from inputs in the Tick() function of the statemachine.

I took me a while to find out that this was the case.

For those who experiences the same thing (now or later), the solution I have found is to create a specific layer (I called it Targeting Layer), place both the Targets and Targeter objects under that specific layer and set up the physics to make that layer only interact with itself (unchecking all the boxes except against itself).

This made it so that the Character controller (which is on a different layer) is not accounted by the Rigidbody. It also, for the better good, culls the number of internal collision detected by the game.

Privacy & Terms