Trigger Event not Working Properly

I’m having a problem with getting a trigger event to work. I’m trying to get it so that when an enemy object collides with an object with the tag “Player” that it destroys the object. Except the event is only being triggered when the player object is falling down while it is in the air.

I made sure that the player object is a non kinematic rigidbody and the enemy object is set up as a trigger but I don’t know if there is a problem with the objects or with the code itself.

Here is the code I’m using for enemy behavior:

function OnTriggerEnter( other : Collider)

{
	
	if (other.tag == "Player")
	{
	Destroy(other.gameObject);
	
	}

}

Posting your code would help see if there’s something not right.

Other than that another problem might be that the player is already inside the trigger in which case it won’t work.

Trigger events fire only when a target enters the trigger, and won’t work if its already inside it. Maybe that’s why when your player is falling down into the trigger for the first time it’s working.