Help How move selected particle in actor from script - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Help How move selected particle in actor from script (/thread-4436.html) |
How move selected particle in actor from script - Zavhoz - 13-01-2025 Hi! Please tell me how move selected particle in actor from script. The general task is: after touching, i find the particle that was touched and move it with my finger. as a result, the liquid should follow the finger. All process in 2D space. Thanks. RE: How move selected particle in actor from script - josemendez - 13-01-2025 (13-01-2025, 08:41 AM)Zavhoz Wrote: Hi! Hi, You can both read and write any particle properties (positions, velocities, etc) using the particles API. See the manual, it explains how to use it together with code examples: http://obi.virtualmethodstudio.com/manual/7.0/scriptingparticles.html Note that directly setting particle properties isn't the only way to achieve what you want. You could also use either colliders or force zones. kind regards, RE: How move selected particle in actor from script - Zavhoz - 13-01-2025 (13-01-2025, 09:02 AM)josemendez Wrote: Hi,Thanks for the quick reply. - in my case, a 2D solution without gravity, so it is not suitable for the force zone, since it only works with 3D colliders. - a collider with the Inverted parameter absorbs all particles, tearing them away from the main mass of the emitter. as a result, the stretching effect does not work. - from the code, the particle also breaks away from the main mass of particles. I want to get the effect as in the picture: [attachment=2285] RE: How move selected particle in actor from script - josemendez - 13-01-2025 (13-01-2025, 01:09 PM)Zavhoz Wrote: Thanks for the quick reply. In Unity you can add 3D colliders to a 2D scene and vice-versa. You can use a force zone just fine, since the ObiSolver is in 2D mode particles will only move in 2D. (13-01-2025, 01:09 PM)Zavhoz Wrote: - a collider with the Inverted parameter absorbs all particles, tearing them away from the main mass of the emitter. as a result, the stretching effect does not work. You don't want to use an inverted collider for this. In any case, a regular collider that pushes particles around (depending on the effect you're after). (13-01-2025, 01:09 PM)Zavhoz Wrote: - from the code, the particle also breaks away from the main mass of particles. This will only happen if you explicitly set a position for the particle(s). What you want to do is add a force towards the user's cursor/finger location instead. The intensity of the force must be proportional to the particle's current distance from the cursor/finger. kind regards, |