so basicly i have an trigger collider on my player, and when i walk close to an enemy it checks if there is someting there and if its an enemy, but i’m having trouble returing the enemy’s GameObject to use it in another script.
public class TriggerTest : MonoBehaviour {
public GameObject target;
void Start(){
}
void OnTriggerStay (Collider other)
{ if (other.tag == "Enemy"){
//Return the GameObject of the "other" here
//So it can be used in other code.
}
}
}
We need to see the code...
– whydoidoitOh sorry, i inserted the wrong thing!
– Brum