Can I make a script when a game object gets triggered by another game object and it checks if it has a certain Variable and what that Variable it? Basically checking if other has that certain value. So if another object it touches has different variables it would use those ones and change the variables depending on what object it touched.
Example:
void OnTriggerEnter2D(Collider2D other) {
if(other.Alive == true)
Attack();
}
Im not sure who to get that component into the equation… If anyone can help that would be great! Thx