1. Home
  2. Docs
  3. Ignis
  4. Tutorials
  5. Interact when an object touches the flame

Interact when an object touches the flame

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:

  1. Implement a IInteractWithFire interface to your own class
  2. Implement OnCollisionWithFire function with your own functionality. The gameobject provided as a parameter is the burning object with “FlammableObject” script.
  1. Attach your new class/component to your desired game object.
  1. Done! Remember to have colliders in your objects when you test this, otherwise flames cannot detect the collisions.

Leave a Reply

Your email address will not be published. Required fields are marked *