1. Home
  2. Docs
  3. Ignis
  4. Tutorials
  5. Extinguish flame using raycast/sphere

Extinguish flame using raycast/sphere

Example Use Case: You have a fire extinguisher which uses VFX graph to produce the foam effect and thus cannot detect collisions.

Example in Demo Scene: Interact->RayExtinguisher extinguishes one cube in the back after the demo scene has played for a while.

How to Implement:

  1. You can extinguish the flame also by raycasting if you don’t want to use particle systems which are more expensive for computational power.
  2. To do this add a “Raycast extinguish” or “Sphere extinguish” component to your game object and adjust the parameters (explanations in tooltips). Sphere does not care if there are objects in front.
  3. After this the extinguishing should happen automatically if ray hits a collider or trigger which is in the flammable object or a child of flammable object.
  4. You can also call CastRayCastExtinguish() from outside of the component and set Repeating Raycast to false, if you want to raycast only on the specific moments.

Leave a Reply

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