How to Put Out a Fire in Unity (Part 2)

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 42

  • @JinHongYu-s9o
    @JinHongYu-s9o 5 місяців тому

    Great and informative video! Do you have any plans to continue on with part 3 of this video that you mentioned?

    • @FeedMyKids1
      @FeedMyKids1  5 місяців тому

      I'm going to do a video on regeneration over time (think COD/Halo health system) which could be used to make fires regenerate if they're not constantly doused.

  • @mariegrasmeier9499
    @mariegrasmeier9499 2 роки тому +1

    Great video, thanks. I am working on a serious game/ microsimulation to to help learning basics of marine firefighting. This will be very helpful and I guess I will adopt a lot of these ideas. Thank you.
    With the raycast approach you can only simulate a stream not affected by gravity or indirect effects, right? I think I will simulate the stream with small rigidbody projectiles ("water drops" in a way). This way, I hope to also be able to simulate a realistic ballistic trajectory and also techniques for indirect attack like aiming at the ceiling to create "rain" on the fire.
    Will also try to tweak your fire model with a simulation of propagation. I think about giving burning objects a temperature, heat release rate, and heat energy which can be inherited from objects nearby. Something like that.
    I am excited how your project will continue and looking forward to more videos :-)

    • @FeedMyKids1
      @FeedMyKids1  2 роки тому

      You have some great ideas for your simulation.
      As far as raycasts being incompatible with gravity: You can fire a ray cast straight from the hose for a certain distance then have subsequent, shorter and shorter, raycasts which "fall" (aim down).
      Or, for example, plot a bunch of points coming out of the hose and do sphere checks about those points (Physics.OverlapSphere) to check if there are fires nearby.
      I tried fire propagation and my implementation was extremely slow. I have another idea for how I'd do it and that might be a future video.

    • @mariegrasmeier9499
      @mariegrasmeier9499 2 роки тому

      @@FeedMyKids1 Hey, thanks for the hint with the raycasts. Sounds really cool. I am still a real noob in terms of all things computer 🙂
      Spent my Sunday on a simple real time fire behaviour model and it worked out quite well. Next will be the interaction between the tiles / burning objects.
      I am really looking forward to your next video on that!
      Cheers, Marie

    • @FeedMyKids1
      @FeedMyKids1  2 роки тому

      @@mariegrasmeier9499 That's way more than I could do when I was a noob. Keep it up!

    • @mariegrasmeier9499
      @mariegrasmeier9499 2 роки тому

      @@FeedMyKids1 ❣

  • @ryanskeats6374
    @ryanskeats6374 Рік тому +1

    Hey, really happy with the progress i've been able to make due to this video!! My one problem is that my extinguisher is not affecting my fire in any way, even with the scripts attached exactly as they are in the video to the main camera, and with the extinguisher being a child to the main cam too. Any idea what this could be? Thankyou.

    • @ATHIRAlSharyani
      @ATHIRAlSharyani Рік тому

      Same issue with me

    • @KampinKarl1
      @KampinKarl1 Рік тому

      I’ll make a video this week as a follow up to this one since a few people have the same problem

  • @enescinar10
    @enescinar10 2 роки тому +2

    nice video please continue

    • @FeedMyKids1
      @FeedMyKids1  2 роки тому

      Thanks.
      I'll continue a little later.
      Gonna switch to some Shooter mechanics in coming videos.

  • @soyjosemillan
    @soyjosemillan Рік тому

    Thank you very much, works fine in VR too

    • @FeedMyKids1
      @FeedMyKids1  Рік тому +1

      Great to hear.

    • @ATHIRAlSharyani
      @ATHIRAlSharyani Рік тому

      Can you help me? I am facing issue

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      @@ATHIRAlSharyaniWhat's the issue?

    • @ATHIRAlSharyani
      @ATHIRAlSharyani Рік тому

      @@FeedMyKids1 when the smoke particles touches the fire particles nothing happen

  • @ananthsundarraj924
    @ananthsundarraj924 Рік тому +1

    really great tutorial ,but in my game i have a particle system water ,it is a VR game so i want to put the fire of only if the water collides over the fire ,how should i change the extinguish script???please help sir because i am a beginner thanks in advance

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      I'm not sure how it would be any different. I don't use VR but I imagine it's about the same in terms of using raycasts or spherecasts. If you aim the water at the fire, it should extinguish.

    • @ananthsundarraj924
      @ananthsundarraj924 Рік тому

      @@FeedMyKids1 thanks considering me I somehow solvd this problem I used the guns raycast to extinguish the fire

  • @WaqasAhmedKhan-m8i
    @WaqasAhmedKhan-m8i 11 місяців тому

    Hello BROTHER, I am Working on VR i have used your idea but the Fire is Dissolving very Fast Even i increase or Decrease the "amount" of that TryExtinguisher Function Can You Help Please ??

  • @arikurniawan7698
    @arikurniawan7698 Рік тому

    Thanks A lot @FeedmyKids1 this tutorial is great and very informative, i used it on my vr for assigment task in my university. i want to ask about the timing of the water output from a hose or an object? i want to combine with a fire extinguisher but i cant trigger it and it always spraying the water
    Thanks

    • @arikurniawan7698
      @arikurniawan7698 Рік тому

      i kinda have it worked in vr but the particles didnt extinguish it i just shove my object that have a camera and its automaticly extinguish how to work around on this?????

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      @@arikurniawan7698 Well, it's not the particles that extinguish the fire. It's just pointing the camera at the fire for a while that makes it go out. So, all you need is a timer on your fire extinguisher and a timeToExtinguish value. Once you're aiming at the fire (unobstructed hopefully), you add to the timer (or subtract to zero) until it's at the timeToExtinguish.

    • @arikurniawan7698
      @arikurniawan7698 Рік тому

      @@FeedMyKids1 Ok thanks for the advice

  • @marianelacavazza1737
    @marianelacavazza1737 Рік тому

    Hey! I just saw your video and downloaded the particle asset, though I couldn't find that water house prefab. Do you know where can I find it? It's no nowhere to be found in my prefabs folder

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      assetstore.unity.com/packages/vfx/particles/particle-pack-127325#content
      Looking at this and examining the Package Content and EffectExamples Folder, under Water Effects you will find WaterLeak.fbx.
      I think I modified that to look like a hose.

  • @MalikGames524
    @MalikGames524 Рік тому

    third part???

  • @pablovillegas2898
    @pablovillegas2898 10 місяців тому

    Great video but i want know how can i access to the burst parameter

    • @FeedMyKids1
      @FeedMyKids1  10 місяців тому +1

      Yeah, good question because it's kind of a weird process.
      Access and save to a variable the emission module of the ParticleSystem - ex
      var em = ps.emission;
      You can directly create ParticleSystem.Burst structs in the EmissionModule.SetBurst /SetBursts methods or create a new Burst separately.
      ex.
      em.SetBurst (new ParticleSystem.Burst (.5f, 30)); //that sets the time at .5f and count to 30
      I created a more detailed example here: github.com/KampinKarl1/How-to-use-Unity-Particle-System-Burst-in-Script/blob/main/Code/EmissionBurstAccessor.cs

    • @pablovillegas2898
      @pablovillegas2898 10 місяців тому

      @@FeedMyKids1 Thanks for the help, it worked for my project and if its not too much can you make a tutorial of how work with Visual Effects parameters(Unity VFX)?

    • @FeedMyKids1
      @FeedMyKids1  10 місяців тому

      Oh man, sorry but I don't know anything about them to be honest.

    • @pablovillegas2898
      @pablovillegas2898 10 місяців тому

      @@FeedMyKids1 Don't problem thanks anyway

  • @SachIn-ls9mm
    @SachIn-ls9mm Рік тому

    I want to know about your Raycast script,
    That is attached in your main camera
    Please tell me

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      Shit, sorry about that.
      This is the exact script that I have in that project:
      github.com/KampinKarl1/Unity-Camera-Components/blob/main/CameraComponents_FeedMyKids/Scripts/Camera/Raycaster.cs
      I'm pretty sure if you revise the fire fighter code in this, you won't find anything that references the Raycaster.

  • @reinste
    @reinste Рік тому

    Could you possibly make the project available for download? I’m having several issues.

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      Hi, sorry you're having issues. I can post the scripts and later post the project with only assets that I've created; Most of what I have in the project (as far as assets) are from Unity and I can't share that.

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      github.com/KampinKarl1/Unity-Extinguish-Fire/blob/main/README.md

    • @reinste
      @reinste Рік тому

      @@FeedMyKids1 Thank you so much!

  • @Duplicity3D
    @Duplicity3D Рік тому

    I can't seem to redirect the water leak... anyone any ideas?

    • @Duplicity3D
      @Duplicity3D Рік тому

      Scratch that, issue solved... I am however wanting to attach the water hose to an object and pick up and turn on water if anyone has any ideas??? I have managed to attach but it doesn't extinguish :(

    • @FeedMyKids1
      @FeedMyKids1  Рік тому

      @@Duplicity3D Hi, if I remember correctly, the extinguisher has to raycast in order to check if it's hitting a fire. It's possible that your object has a collider that is essentially "blocking" or absorbing the raycast and doesn't allow for checks in front of it. Try setting the object's layer to IgnoreRaycast and see if that works.