# how to recieve a trigger with collider or recieve a trigger with collider in unity

i know if your object has a Collider you can sense another Collider with OnCollisionEnter function or... and you can sense another collider with trigger with OncollsionEnter function and... but i want to sense other object with trigger even with collider or even with trigger. i cant sense otherobjects that have triggers. for example i have bullet that as i dont want to collider have any physics i turned it to trigger but how can make a charcter to sense it?

Thank you for helping

It's more than simple, but remember you must have attached rigidbody on either object.

Second is tag. It is one of the many ways to detect any specific object through tag. Create a specific tag by selecting any GameObject from hierarchy, in inspector click on tag drop down and add a new tag, for example bullet. Set the tag of your bullet to the newly created one, i.e. bullet

Now I'm assuming that your character have rigidbody attached then you can detect through script attached to your character by,

void OnTriggerEnter(Collider collider)
{
if(collider.gameObject.tag == "bullet") // this string is your newly created tag
{
// TODO: anything you want
// Even you can get Bullet object
GameObject strikingBullet = collider.gameObject;
}
}