OnTriggerEnter or If statement problem

Hello, everyone.
I’m not a native English speaker, so please be generous with my grammatical faults.

Hello,again.
I’m working on 2D game like BubbleBobble(by TAITO), using Unity 4.3 version.
Here’s simple rules in my game.

(1) Player blows bubbles, and Enemy meets bubbles, it’s captured in bubbles.

(2) Once Enemy is captured in a bubble, it will be destroyed when Player hit it.

So, Enemy has two animations; “Idle” and “Captured”, also it has a transition condition Boolean type “IsCaptured”, and is set false as default value.

(1) works successfully, but (2) goes strange way, and I don’t know why.
Please see my script codes below.


function OnCollisionEnter(col: Collision) {
    	
    	myAnim.SetBool("isCaptured",true);
    	transform.Translate(Vector2.up * Time.deltaTime);
    	this.collider.isTrigger = true;
    }
    
    function OnTriggerEnter(other: Collider)
    {
    	if(other.gameObject.tag == "Player" && myAnim.GetBool("isCaptured") == true)
    	{
    		Destroy(this.gameObject);
    	}
    }

Problem is, even though the “if statement”, all the Enemies are destroyed when they collide with Player!

I can’t find where is wrong.
I think it doesn’t have any logical errors, but I’m not sure.

Please, help me.(T_T)
I’m so exhausted to find out alone.(T_T)

I’m not sure what you mean by ‘Enemy’. If the Enemy is a Prefab; after destroying Prefabs do not exist inside the scene, they are in the project. You should not be destroying Prefabs, will effect each other.

if you use

Destroy(this.gameObject);

it’ll destroy the gameobject in which you have placed the script…

Destroy(gameObject);

it’ll destroy particular gameobject what you have specified.

Is there anyone have any idea about this, anymore? T_T

Unity’s expert doesn’t check these questions? T_T