OnTriggerEnter(Collider col) allows you to store a reference to the colliding gameObject/collider. Inside you can simply check if the collider is the one you want to detect and run your code based on that result.
For example:
When doing it like this, DoStuff() is only executed when the colliding game object’s collider is not set to “isTrigger”. This is just an example. You can, of course, check for other properties to identify the object, like name or position.
Hope this helps.
Thanks for your response. I completely forgot about the .isTrigger check.
Thanks for your response. I completely forgot about the .isTrigger check.
– coling1