Particles follow event

I am sure that there is probably a very easy way to do this, but I am having some trouble.

I would like to put an emitter on an object, and then have particles emit from there to any point on the screen where the user touches.

I was thinking of using SetEmitterTarget, but I cannot figure out how to pass the appropriate variables (namely event.x and event.y)

Has anyone done anything like this before? [import]uid: 102017 topic_id: 19102 reply_id: 319102[/import]

Did you find a solution? I am interested in this effect as well. [import]uid: 109677 topic_id: 19102 reply_id: 81927[/import]

So you basically want to “send” particles to a certain x/y position? Is this correct? [import]uid: 10504 topic_id: 19102 reply_id: 82676[/import]

I would like to know how to send particles to a certain x/y position as well. [import]uid: 93332 topic_id: 19102 reply_id: 84622[/import]

We’ll see if we can add such a feature with the next update. [import]uid: 10504 topic_id: 19102 reply_id: 84927[/import]

That would be great. Thanks! [import]uid: 93332 topic_id: 19102 reply_id: 85065[/import]

This is exactly what I am trying to do, was looking for info here, has this been implemented now? [import]uid: 207496 topic_id: 19102 reply_id: 141391[/import]

Well, actually this can be solved quite easily by simply rotating the emitter to face the xy coords where you want to send your particles to:

[lua]
– POINT EMITTER TO TOUCH POSITION
local PI = 180 / (4*math.atan(1))
local function touched( event )
local E= Particles.GetEmitter(“E1”)
if “moved” == event.phase then
E.rotation = ( math.atan2( (E.y-event.y), (E.x-event.x) ) * PI ) - 90
end
return true
end

BGImage:addEventListener( “touch”, touched )
[/lua]

You could also place an FX Field (attraction mode) to the touch coordinates to attract the particles additionally. [import]uid: 10504 topic_id: 19102 reply_id: 141839[/import]

This is exactly what I am trying to do, was looking for info here, has this been implemented now? [import]uid: 207496 topic_id: 19102 reply_id: 141391[/import]

Had problems coming up with math formula for this. Very helpful, thank you. [import]uid: 207496 topic_id: 19102 reply_id: 142261[/import]

Well, actually this can be solved quite easily by simply rotating the emitter to face the xy coords where you want to send your particles to:

[lua]
– POINT EMITTER TO TOUCH POSITION
local PI = 180 / (4*math.atan(1))
local function touched( event )
local E= Particles.GetEmitter(“E1”)
if “moved” == event.phase then
E.rotation = ( math.atan2( (E.y-event.y), (E.x-event.x) ) * PI ) - 90
end
return true
end

BGImage:addEventListener( “touch”, touched )
[/lua]

You could also place an FX Field (attraction mode) to the touch coordinates to attract the particles additionally. [import]uid: 10504 topic_id: 19102 reply_id: 141839[/import]

Had problems coming up with math formula for this. Very helpful, thank you. [import]uid: 207496 topic_id: 19102 reply_id: 142261[/import]