x


Detecting Particle Collisions

Is it possible to detect where a stream of particles is colliding? I don't need the particles to bounce or anything crazy like that. I just need to know if it's intersecting a mesh. Is that within the range of Unity's capabilities?

more ▼

asked Jan 27 '10 at 06:06 PM

inveni0 gravatar image

inveni0
107 3 5 6

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

I haven't tried this pefore, but thought of doing something like that for a flamethrower. Check this out, it might help:

http://unity3d.com/support/documentation/Components/class-WorldParticleCollider.html

more ▼

answered Jan 27 '10 at 07:31 PM

sulas gravatar image

sulas
111 5 5 11

(comments are locked)
10|3000 characters needed characters left

there is a component called particle collider that you can use to make particles lose energy or bounce or ... when colliding with other particles. there is a check box (bool value) in this component called SendCollisionMessage that if you check it a OnParticleCollision event will be called in all scripts attached to the GameObject containing the particle collider and the GameObject that particles collided with. so you can use this function in your mesh object and do what you want when particles collide with you. as you can see in the sample of documentation you can see the object that you collide with in the passed argument.

more ▼

answered Jan 27 '10 at 08:20 PM

Ashkan_gc gravatar image

Ashkan_gc
9.1k 33 56 117

I should add that I'll be developing on iPhone. The goal is to have a narrow stream of water. Would message sending incur too high a load on the iPhone platform?

Jan 28 '10 at 04:08 AM inveni0

you can test it for yourself. it's depending on many factors. try to keep the code inside message lightweight and you'll be good to go. i don't have any experience in iphone development.

Jan 28 '10 at 05:23 AM Ashkan_gc
(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:

x2504
x2001
x642

asked: Jan 27 '10 at 06:06 PM

Seen: 5959 times

Last Updated: Jan 27 '10 at 06:06 PM