Forum

Setting the position of a particle, then releasing it

I’ve just watched Joregs Object Oriented Patching Node 20 course and learned a lot, I’ve been tinkering with trying to create a particle when you click the mouse button, and want it to follow the mouse while the left mouse button is down, and then when it is released, for it to take the last position, and then for its life to start counting down.

I think I’m close, but am missing something.

Basic Particle7.vl (34.1 KB)

Like this?
Basic Particle7.vl (38.1 KB)

I introduced another property to the particle to know if a particle is still “captured” by the mouse or already released.

1 Like

Yeah, that’s perfect!

Next iteration of this is that I want to make this work now for multitouch, I’ve almost got it I think, but something with the touch notifications isn’t quite correct, I’m using a reactive S+H to capture the notifications, then IsTouchDown and IsTouchUp to trigger the initial state, then the update.

Basic Particle - Multitouch.vl (92.5 KB)

there are different ways to do this. here is one:
Basic Particle - Multitouch.vl (100.1 KB)

please let me know if you have any further questions.