x


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!

more ▼

asked Jul 14 '12 at 03:47 PM

riekelt gravatar image

riekelt
3 2 3

Your particle syste, is an object so you can destroy it like any others.

Jul 14 '12 at 04:08 PM fafase

But how do i detect if my water hits the fire?

Jul 14 '12 at 04:10 PM riekelt

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.

Jul 14 '12 at 04:20 PM fafase

Its the standard particle effect.

Jul 14 '12 at 04:24 PM riekelt
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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...

more ▼

answered Jul 14 '12 at 04:32 PM

fafase gravatar image

fafase
11k 11 15 45

Thanks worked!

Jul 14 '12 at 05:07 PM riekelt
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jul 14 '12 at 04:30 PM

LaserPanzerWal gravatar image

LaserPanzerWal
0 1 1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x304
x153

asked: Jul 14 '12 at 03:47 PM

Seen: 355 times

Last Updated: Jul 14 '12 at 08:12 PM