How to activate a trigger only by the Player

Hi, well, i have a door activated by “E” key, and a GUI text that appears only when im stay inside the trigger field of my door, everything is ok, but when i shoot to the door from far away, the trigger is activated and i see the GUI text from far away, i want the trigger will be activated only by the player, so i use this:

function OnTriggerStay(hit:Collider){

	if(hit.gameObject.tag == "Player"){
	
		action = true;
	}
}

and is ok, the only problem is that my bullets now collide on the trigger and dont go through the open door anymore, any idea why the bullets collide on the trigger?, thanks.

Hey,

All you have to do is set your bullet to a different physics layer and set up your matrix correctly so that the bullets can’t hit the door.

http://unity3d.com/support/documentation/Components/class-TagManager.html

http://unity3d.com/support/documentation/Components/class-PhysicsManager.html

Good luck! ;]