Hi I’m trying to get it to where when 2 of the player objects are too close to each other and both on the ground that they will destroy each other.
Both of them have a bool “airborn” but I don’t know how to make it so that I can retrive the airborn of the other player. Here is my code:
var allfoes = GameObject.FindGameObjectsWithTag("PLAYERS");
foreach(GameObject MYfoe in allfoes)
{
var dist=Vector3.Distance(transform.position, MYfoe.gameObject.transform.position);
if (dist<.6f && MYfoe.gameObject!=gameObject && airborn && MYfoe.gameObject.airborn) Destroy(GameObject);