CharacterLocomotion is using an inactive collider

CastleSeven

New member
1. Ultimate Character Controller - v 2.3.6
2. 2020.3.18f1 (built-in RP)
3. It appears the Character Locomotion script, specifically the DeflectHorizontalCollisions() method, is using colliders that are NOT active in the hierarchy to determine when a collision is made.
4. Reproduction / specifics:

I have a single UCC character that has a variety of models it's capable of using. The active model is selected based on some user-specific settings after we get into this particular scene. It is important to note here that CharacterLocomotion's Awake() method has been called when all of the character models are active, so Colliders that will eventually be made inactive in the hierarchy are added to the colliders list (and their gameobjects cached).

After this caching and array building has been completed, our script determines the correct user model and disables all the other ones.

When traversing the environment, I noticed my character was routinely getting stuck on walls and corners even though I had plenty of space around the model. See below picture:
1636652355191.png

I discovered by adding debug prints to CharacterLocomotion.cs that the active collider being referenced in DeflectHorizontalCollisions() was indeed a collider that was NOT active in the hierarchy (In this case, a diver model with it's colliders in t-pose) .
1636652400224.png

We didn't have any issues until after upgrading to UCC 2.3.6 and Unity 2020.3.18f1. I realize this could simply be a change in execution order, but it seems like there should be a check on whether or not the collider is active prior to acting upon it. If a check exists, there is likely an issue with it:

1636653163676.png

Is there a way, maybe after we select the appropriate initial model, or after the user decides to switch models mid-game, that we can force the locomotion subsystem to re-init the colliders?


5. No Error messages.
 
The colliders array gets populated based on the layers. Make sure your colliders use the SubCharacter instead of the Character layer.
 
Top