For some reason when I fire a projectile (which has Trigger enabled) at my terrain (which is not a trigger) OnTriggerEnter is not being called every time the object hits it.
For example: Dropbox - 2015-03-17-2355-20.flv - Simplify your life
And here is the OnTriggerEnter function (located in the projectile script):
void OnTriggerEnter(Collider other)
{
Debug.Log("enter " + other.gameObject.name);
if (type == ProjectileType.Player && other.gameObject.tag == "Player")
return;
if (type == ProjectileType.NPC && other.gameObject.tag == "NPC")
return;
if (!exploded)
{
Debug.Log("explode " + other.gameObject.name);
exploded = true;
TerrainController.Instance.GenerateExplosion(rigidBody.position, explosionPower);
GameObject audio = (GameObject)Instantiate(audioPrefab, rigidBody.position, Quaternion.identity);
GameObject particalObj = (GameObject)Instantiate(partical, rigidBody.position, Quaternion.identity);
audio.GetComponent<AudioSource>().Play();
Destroy(particalObj, 5);
Destroy(audio, 5);
Destroy(gameObject);
if (type == ProjectileType.Player && other.gameObject.tag == "NPC")
other.GetComponent<NPCControll>().Break();
}
}