`
function CheckDeath()
{
if(state!=_State.Dead)
{
if(Hp<=0)
{
disabled=true;
state=_State.Dead;
var CtP=GameObject.Find("ContactPoint");//name all weapons or dmg points this for monsters.
CtP.collider.enabled=false;
var chance=Random.Range(1,100);
if(chance>49)
{
Instantiate(PowerUpDrop,transform.TransformPoint(0,Random.Range(1,3),Random.Range(-1,-3)),Quaternion.identity);
}
targetinfo.LevelExp+=ExpGiven;
animation.Play("ko");
yield WaitForSeconds(5.0);
disabled=false;
Destroy(this.gameObject);
}
}
}
`
I’d like to disable the contact point object (var CtP). However using the code I have now, it disables this object on all objects in the scene. Is there anyway I can make it so that the contact point for only one gameobject gets disabled?