As you place triggers within your scene you may notice that the character collides with it as if it is a regular collider. The controller uses various forms of Physics.Raycast for some of its collision detection and by default the raycast will hit a trigger. There is a separate raycast method which can ignore triggers but this version allocates memory so we avoid it. There are two ways to prevent the raycast from hitting the trigger:
- Set your trigger collider to have a layer of Ignore Raycast
- In Unity's Physics Manager you can completely disable raycasts from hitting triggers by disabling "Raycasts Hit Triggers"
<- Modify Code for Easy Updating