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

Ignite flame using raycast/sphere

Example Use Case: You have a flamethrower which uses a VFX graph to produce the flames and thus cannot interact with objects. You want the flamethrower to be able to ignite objects.

Example in Demo Scene: Interact->RayIgniter can be enabled and it will ignite the oil instead of the “Fire” gameobject.

How to implement:

  1. You can ignite the flame also by raycasting/sphere if you don’t want to use particle systems which are more expensive for computational power.
  2. To do this add a “Raycast ignite” or “Raycast sphere” 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 igniting 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 CastRayCastIgnite() 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 *