OnTrigger, OnCollison

Hi,

Im having trouble with OnTrigger and OnCollision, I’ve built a animated mouse and paired a weapon (a pole) by script to its left hand, the weapon has a capsule collider on it and I’ve set its trigger to on, now in the scene I have a box (cheese box) with a box collider so when the mouse swings the weapon and hits the box the script attached to it (and below) should be registering the hits but its not working, I’ve also tried OnCollision with the weapon trigger off again with no luck, is it something to do with the weapon being paired by script to the left hand?

Any help would be greatly appreciated.

var explosionPrefab : Transform;
var sparklePrefab : Transform;
var WoodSound : AudioClip;
var MetalSound : AudioClip;
var BrickSound : AudioClip;
var audioSources;

private var CheeseBoxHitCount = 0;

function OnTriggerEnter (other : Collider)
{
	audioSources = new AudioClip[5];
	 
	if(other.gameObject.tag == "CheeseBox")
	{
		audio.PlayOneShot(WoodSound);
		CheeseBoxHitCount = CheeseBoxHitCount + 1;
	}
	else if(other.gameObject.tag == "MetalBox")
	{
		audio.PlayOneShot(MetalSound);
	}
	else if(other.gameObject.tag == "Wall")
	{
		audio.PlayOneShot(BrickSound);
	}
		
	var explodePosition : Vector3 = transform.TransformPoint(Vector3.zero);
		Instantiate(explosionPrefab, explodePosition, Quaternion.identity);

	if(CheeseBoxHitCount > 2 && other.gameObject.tag == "CheeseBox")
	{
		Destroy (other.gameObject);
		var sparklePosition01 : Vector3 = other.gameObject.transform.position;
		Instantiate(sparklePrefab, sparklePosition01, Quaternion.identity);
		CheeseBoxHitCount = 0;
	}
}

I may be wrong here but when using OnTrigger one of the two colliders needs to have a rigidbody attached as well as at least on of the colliders need to have isTrigger checked.

Try this and if it doesn’t work come back and I will try and help!