Example use cases: Enemy takes damage when it touches flame, Barrel explodes when it touches flame
Example in Demo Scene: Scene Setup -> Main Camera has an example script for interacting with flame. If you attach a collider to the main camera and move it to the flames a debug message will pop up.
How to implement:
- Implement a IInteractWithFire interface to your own class
- Implement OnCollisionWithFire function with your own functionality. The gameobject provided as a parameter is the burning object with “FlammableObject” script.
- Attach your new class/component to your desired game object.
- Done! Remember to have colliders in your objects when you test this, otherwise flames cannot detect the collisions.