Access different colliders from one one script (858375)

Hello! I was wondering if it is possible to access different colliders from one script?

I want to be able to do something like this:

I can determine that if the player enters this spesific collider, then I change a value to something, but if the player enters another spesific collider, I want the value to change to something else.

Is there any way to do this from one script? Some sort of Collider Manager? Instead of creating an “OnCollisionEnter” on every individual box collider?

You need one script on the player with one OnColliderEnter and based on the other collider you can make a decision what to do. This is the exact reason why you get the other collider in the parameter.

1 Like