x


Particle Emitter from moving object to cursor location

The emitter is currently attached to a parent and it emits while the left mouse button or space bar are pressed down. I would like to emit the particles towards the mouse/cursor location on screen; however, at the moment, the particles move straight up vertically.

How can I aim the particles towards the cursor dynamically?

more ▼

asked Aug 10 '11 at 07:16 AM

GTHaxor gravatar image

GTHaxor
16 6 8 10

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

1 answer: sort voted first

There's an initial velocity property in the particle emitter. Set it to point towards the mouse cursor's position in your script.

more ▼

answered Aug 10 '11 at 08:23 AM

Arshia001 gravatar image

Arshia001
91 11 12 14

I'm pretty new to Unity and my Javascript knowledge is a bit flaky. Could you please include a snippet of code that would accomplish this?

Aug 10 '11 at 08:27 AM GTHaxor
(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:

x318
x244
x198
x89
x80

asked: Aug 10 '11 at 07:16 AM

Seen: 1053 times

Last Updated: Aug 10 '11 at 08:27 AM