Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  move each particle of cloth
#1
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.
Reply
#2
(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
Reply
#3
(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?
Reply
#4
(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.
Reply
#5
(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.
Reply