Can i check if something enters my collider?

onTriggerEnter checks if this object enter trigger, can i check if something enters to this trigger? i need to check it from script on trigger

again
i want to have trigger attached to my player, and i want to return colliders in this trigger;

According to what I understood from your question.
You want to know/return what is the object that entered you trigger.

check this example.

function OnTriggerEnter (other : Collider)
    {
  		if(other.gameObject.tag == "enemy")
       	{
	       // do something	
        }
		else if (other.gameObject.tag == "bullet")
		{
			// do something else	
			// for example decrease health
		}
		else if (other.gameObject.tag == "coin")
		{
			// do something else	
			// increment number of coins
		}
		// and so on .....
                  
    }

but, of course you have to set the tags to your gameobjects in your scene, and check accordingly.
If you don’t know how to do that, that’s a different topic, check it here or do some little search.

I went to post a question but my answer page didnt have a submit button and the preview didnt work and the suggested tags just weren’t there. So this is my last resort I am truly sorry but could someone please help me. :slight_smile:

I have a script (Script1) and I have this script attached to an object (Object1). I have another object (Object2). I have a player (Player1).

I need Script1 to check if Player1 has entered Object2’s collider. Is this possible? I know how to use OnTriggerEnter(player:Collider) but I need it to do something like the following > OnTriggerEnter(player:Object2.Collider). Any Ideas appreciated.