Hello Unity3D.I have a question about OnCollisionEnter.Can i use OnCollisionEnter to force the enemy to play an animation without the enemy having any OnTriggerEnter script attached to it?The reason i ask this question is the fact that i am trying to make one of my characters be able to throw a enemy and i was wondering if i needed both parties to have a script or just one of them needs a script for this.If i only need a OnCollisionEnter script for me to be able to throw an opponent.Is this script correct then?
#pragma strict
var sceneCam : GameObject;
sceneCam = GameObject.Find("MainCam");
function OnCollisionEnter(collision : Collision){
if(collision.gameObject.tag == "Dummy") {
sceneCam.transform.position = Vector3(-20.46, 4.258904, -805.3136);
if(animation.IsPlaying("punch1")){
animation.Play ("Hit1");
}
}
}