Mob not detecting weapon trigger.

I have a game setup where the player has a weapon that has a box collider that is a Trigger.

It also has a rigidbody. I’ve played around with the settings of the rigidbody. I’ve changed the angular velocity, the isKinematic bool, I have set it to discrete, and continuous dynamic and dynamic.

The mob has a character controller.

It doesn’t register the trigger enter for some reason.

The mob also has a weapon with a box collider and it can hit the player no problem.

Both are also continuously moving very very slightly in the update, so little a person doesn’t notice. I added this so it better detects collisions.

The mobs weapon has no rigidbody and works.

Yet the players weapon even without a rigidbody will only be detected rarely after attacking continuously with or without a rigidbody.

Sometimes the player weapon works sometimes it doesn’t.

If you need more info or have information let me know. Thank you.

You should be careful, and Particular, when and how you use collisions. Certain conditions need to be met, depending on which style of detection your going to use. Firstly, make use of debug.log, and check collapse, in the console window. This will prevent alot of frame lag. Just monitor those numbers on the right, and if it changes, you got a winner.

Second, your using something like collision.hit, that may run indefinitely, if the colliders are still in contact. You should try something more controlled like OnCollisionEnter, then only the first contact counts, until the colliders are no longer in contact.

After that, if it only collides once, you need to make sure the colliders get a chance to ‘reset’. You can do this by checking if a collision occured, and setting a timer to manually allow another OnCollision event.

GL!