OnTriggerEnter is often not working

I’m trying to make a shooting system. I use rigidbodys for the bullets and I want to make the hit detection with the a hitbox of the ridgidbody object. I’m using the “OnThriggerEnter”-function for that. But for some reason, the function is working sometimes and sometimes not. Sometimes the script does what it should do and sometimes, my bullet is just flying thought the object. That’s my script:

Script on Objects:

import UnityEngine

class DamageTaker (MonoBehaviour): 
	health as int = 300
	def Update ():
		if health <= 0:
	def ApplyDamage(dmg as int):
		health -= dmg
	def die():

Script on bullet object:

import UnityEngine

class BulletDamageScript (MonoBehaviour): 
	dmg as int = 50

	def OnTriggerEnter (hitObj as Collider):
		hitObj.SendMessage("ApplyDamage", dmg, SendMessageOptions.DontRequireReceiver)

As you can see, the language is Boo.

How fast are your bullets moving? For very fast moving objects, the physics don’t always work - the rigidbody might move too far between frames. Even if that is not the case, I find that OnTriggerEnter() is not particularly reliable.

Edit: You may also try setting collision detection on your rigidbodies to Continuous and using Intrpolation. Also, playing with physics steps in the settings might help (or make things worse;) )

Very often, for shooting fast projectiles over short distances (where wind, gravity, and other effects can be approximated by small constants) hit detection is done using raycasting from the barrel, and bullets, tracer trails etc are just graphics effects.
If that doesn’t work for you, consider a hybrid method - raycast forward a small distance from the flying bullet and use that to determine if the bullet is about to hit something.

Try pitting it in a public void called Update