x


How to access particle collision locations

Hi!

I am trying to make a particle based machine gun!

so far everything I have needed has come from the scripting reference, but I have been having trouble figuring out how I can tell a script where a particle collision was in a variable. This is so hit sparks can be made at a collision point.

I think what might work is telling the script that when a particle has collided, to instantiate the sparks at it's location, rather than at the collision point, which apparently the OnParticleCollision function doesn't do.

Thank you!

AJ - indie game maker and dreamer... lol :)

more ▼

asked Jun 01 '10 at 06:39 AM

Ariel J gravatar image

Ariel J
64 6 6 9

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

2 answers: sort voted first

We are actively working on collision messaging ATM and with any luck it should go into Unity 4.2. This will let you read collision impact points, incident velocity etc. With this data you can easily cause damage and/or apply forces to collidees.

more ▼

answered Mar 07 at 03:00 PM

Jesper Mortensen gravatar image

Jesper Mortensen
36 1

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

If I would be in you I'd just use a raycast to see where the gun is aiming and just relocate a particle emitter of sparks in that location (at the crossing of the ray with the first mesh). No need to spawn it: just spawn it when the player hits FIRE, then relocate it to raycast landing point until FIRE is pressed.

Hope this is a good solution for you :)

more ▼

answered Jun 01 '10 at 07:23 AM

GODLIKE gravatar image

GODLIKE
469 5 9 20

That would always work, but I just want to see if it was possible, in case I needed particles for something similar to above

Thanks!

Aj

Jun 01 '10 at 10:16 AM Ariel J
(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:

x2584
x659
x335

asked: Jun 01 '10 at 06:39 AM

Seen: 1699 times

Last Updated: Mar 07 at 03:00 PM