- Home /
Is it possible to create fire that you can put out?
Hello everybody! I am looking for a script that allows my players to put out fire. I am going to use it for a multiplayer game.
Please help!
Your particle syste, is an object so you can destroy it like any others.
What is your water made of? Is it a particle effect too or a more primitive shaped object? Then you would have to detect collision and destroy the obejct.
Answer by fafase · Jul 14, 2012 at 04:32 PM
OK now that we have the information you can use this:
http://docs.unity3d.com/Documentation/Components/class-WorldParticleCollider.html
that you place on the water. Read it through to know what to do (exemple, enable Send Collision Message)
Then
function OnParticleCollision (other : GameObject) {
if(other.tag =="Fire_tag"){
Destroy(other);
}
}
Add a collider box to your fire, tag your particle system with Fire_tag (or else) and you should be good to go.
P.S: I do not have Unity to try it so I might have missed a detail...
Answer by LaserPanzerWal · Jul 14, 2012 at 04:30 PM
Colliders will do it. I dont know how the fire and the water will be featured in your game, but basically you could add a collider to the fire prefab and check if it is hit by water. If you use colliders or cast a ray, sphere or whatever against it depends on how youre going to implement it of course. Then, if hit, simply destroy the fire object and the fire is out.
Your answer
Follow this Question
Related Questions
WaterProDayTime and fire reflection issue 0 Answers
How to make extinguish? 1 Answer
Unity 5: Water Shader and Fog Not Rendering 1 Answer
Procedural water generation 1 Answer
[script attached] Simple flying script 3 Answers