Obi Official Forum

Full Version: move each particle of cloth
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I would like to move each particle of cloth. My image is that pushing cloth from inside of tube shaped cloth. I want it to transform its shape depending on power.
(18-02-2019, 03:22 PM)Richard Wrote: [ -> ]Hello. I would like to move each particle of cloth. My image is that pushing cloth from inside of tube shaped cloth. I want it to transform its shape depending on power.

Hi,

You can get/set any of the particle properties (positions, velocities, radii, etc) using the arrays in the solver class. See the docs for details:
http://obi.virtualmethodstudio.com/tutor...icles.html
(19-02-2019, 09:10 AM)josemendez Wrote: [ -> ]Hi,

You can get/set any of the particle properties (positions, velocities, radii, etc) using the arrays in the solver class. See the docs for details:
http://obi.virtualmethodstudio.com/tutor...icles.html

I cannot image how to do. What if I move some of particles to X axis and then Z axis?
(19-02-2019, 09:26 AM)Richard Wrote: [ -> ]I cannot image how to do. What if I move some of particles to X axis and then Z axis?

Hi,

Particle positions use the standard Unity Vector4 datatype. So to set the X value and the Z value, you simply pass them to the constructor as you normally would.

Code:
solver.positions[index] = new Vector4(x,y,z,0);

Please refer to Unity's documentation for more info how to use the Vector4 class.
(19-02-2019, 11:48 AM)josemendez Wrote: [ -> ]Hi,

Particle positions use the standard Unity Vector4 datatype. So to set the X value and the Z value, you simply pass them to the constructor as you normally would.

Code:
solver.positions[index] = new Vector4(x,y,z,0);

Please refer to Unity's documentation for more info how to use the Vector4 class.

Hello. 

How can I pick up particles on script? I want to choose particles like around arms and shoulders.