Not sure how to word this exactly, so I’ll just give a sample of code. I’m just wondering if there’s a way to do this without making 2 scripts. I have a simple AI that paths around, and I want it to chase the player when he walks into a collision zone. So this script would be on the enemy
void onTriggerEnter(Collider coll){
if(coll.gameObject == player){
//do stuff
}
//so is there a way to do something like this, in this script?
it(chaseArea.coll.gameObject == player){
//do different stuff
//basically checking to see if someone collided with the chaseArea GO in the same script
}
}
Is there a simple solution to this? Or do I just need to make another script and reference it? I’ve been using unity for a while and I’ve never managed to figure this one out.
Thanks!