How to trigger and collision at the same time?

I’m a noob in unity, I will try to explain.

I have an object that is trigger. It is a ladder.
When my characterController enters into it I run code in the own characterController and then he can take the stairs. Up to this point, all is right.

The problem is when my character collides with an enemy object, which in theory should hurt him. if my character is trigger with stairs, he ignores collisions with enemy objects because the enemy objects ignore collisions with own stairs, and my character is not damaged.

you can say: don’t ignore collisiones between stairs and enemy objects. But then keep in mind that this should only execute the code when the main character collides with the stairs (not other objects), because I’m using OnTriggerStay and OnTriggerExit.

Sum up:
A istrigger with B.
C ignores collisions with A.
As result: C ignors collisions with B

Any solution to the problem?

Apologies for my english, than you and best regards.

You most likely have OnTriggerEnter() for your detection of the player entering the ladder trigger. However, you’re not specifying which trigger the player is colliding with so Unity thinks that enemy trigger and the ladder trigger are the same thing.

I don’t know C# too well, but try some along the lines of

void OnTriggerEnter (){

//Get name of trigger

// if it's ladder trigger
   // do ladder thing

// if enemy trigger
   // damage player

}