The Character Controller is a Collider. So, in theory it should be possible to be set as a trigger. However, in practice if you set it as a trigger through script (not possible in the Inspector), its behavior is weird. You cannot go through it (as you would a trigger), but yet it triggers OnTriggerEnter events (randomly).
The scripting reference, shows that isTrigger is an Inherited member/Inherited Variable for CharacterController. So, the following script:
using UnityEngine;
using System.Collections;
public class SetTrigger : MonoBehaviour
{
private CharacterController controller;
// Use this for initialization
void Start ()
{
controller = GetComponent<CharacterController>();
controller.isTrigger = true;
}
void OnTriggerEnter(Collider other)
{
print("Trigger was Hit");
}
}
…when attached to a game object with a character controller should make it behave as a trigger… … but it doesn’t.
In fact, when debugging this, it can be seen that the CharacterController gets isTrigger set to true. However, a First Person Controller (with another Character Controller) stops upon collision, instead of going through it (as a trigger). Nevertheless, it fires -occasionally- an OnTriggerEnter event.
Is this a bug? Am I missing something, or what?