Make a VR Fire Extinguisher to put out various fires

Hey guys, I’m fairly new to VR in Unreal and have come seeking some advice for a health and safety game im creating.

The game requires the pickup of the correct fire extinguishers, navigate to the danger area and pull the trigger to activate the particles (water, co2, powder or foam) based within the fire extinguisher BP to put out the correct fire type.

I desperately need some expert advice on is the following:

  • How do I activate the particles only when the user is holding the fire extinguisher and pressing a particular button?

  • I want to make the fire either extinguish or act more violent depending on which extinguisher is used, therefore, should I be using mesh for the particles and trigger box around the fire to activate a matinee sequence or is there another way to get the extinguisher particles to interact with the fire?

  • Should I replace the motion controller hand with the extinguisher upon pickup? or just have it picked up whilst squeezing the trigger?

Any advice or guidance would be greatly appreciated.

  • How do I activate the particles only when the user is holding the fire extinguisher and pressing a particular button?

You can already have the Particle System in a Particle System Component as part of the Fire Extinguisher BP. Then you can activate with Activate and deactivate it with Deactivate.

Here is a detailed tutorial on using Particle systems in actors: Unreal Engine 4 Particle Systems Tutorial | raywenderlich.com

  • I want to make the fire either extinguish or act more violent depending on which extinguisher is used, therefore, should I be using mesh for the particles and trigger box around the fire to activate a matinee sequence or is there another way to get the extinguisher particles to interact with the fire? *

You can fire a ray from the extinguisher to the fire in front of it and, for example, get a tag from the colliding fire actor (assuming the fire is also a BP). Based on the tag, you can check whether it is appropriate for the extinguisher you are holding or not. The tutorial above also shows how to change the particle effects on the fly, so you could change the reaction of the fire to the extinguisher using that logic.

  • Should I replace the motion controller hand with the extinguisher upon pickup? or just have it picked up whilst squeezing the trigger? *

This depends on the effect you are trying to achieve. I prefer to keep things simple, so once you are holding the fire extinguisher I would make the hand disappear, but this is my personal preference.

Good luck with your project, it looks cool!

Thanks so much for the detailed reply Marco - greatly appreciated! I will have a look at the tutorial that you provided shortly…Cheers :slight_smile:

Good! Forgot to mention something. When you attach a particle system to a VR component affected by late update (like a Motion Controller) you may experience that when you move the Fire Extinguisher the particle system lags a bit behind. If this is the case, you may have to turn off Late Update on the Motion Controller.

Hi Marco, sorry to be a pain - I was able to create the water particles and add the system to the Fire Extinguisher BP. however, I was unable to activate and deactivate the particles based on the following conditions:

  1. The motion controller must overlap the capsule trigger on the extinguisher AND
  2. The grip or face button must also be pressed

As my blueprinting knowledge is also very slim, could you please advise on how I can achieve this. I have searched and read multiple tutorials on particles and blueprints, however, I am still not able to get the desired result. Any help or guidance would again be greatly appreciated.

I have now managed to achieve all of the above using a variety of tutorials and help from the Unreal community (Thanks all) I used the following setup:

  • BP interface with the Interact, action, release and line trace named functions
  • Get overlapping actors on FPS to fire Interact function to attach the fire extinguisher component
  • Check that the character is holding the extinguisher
  • Only when holding and pressing the trigger they can then fire the ‘Action’ function which activates particles on the fire extinguishers and also shoots line traces
  • When the line traces hits certain actors, they then casts to the correct BP and fires custom events to deactivate the particles and audio…

PHEW!! got there in the end!!

Here is a link to the test video: https://www.youtube.com/watch?v=8QEX9skoGm0&feature=youtu.be

How did you manage to get the extinguisher to put out the fires? Line traces?