19-10-2021, 11:27 AM
(This post was last modified: 19-10-2021, 11:28 AM by josemendez.)
(19-10-2021, 11:24 AM)Matbee Wrote: Oops, I accidentally replied to my own message) .
_rope.solver.actors[0].particleCount. I got the number of particles of the actor, but the list of all particles how can i get?
From the example in the manual:
Code:
// Iterate over all particles in an actor:
for (int i = 0; i < actor.solverIndices.Length; ++i)
{
// do something with each particle
}
For instance, to print the solver-space position of all particles (including inactive ones):
Code:
for (int i = 0; i < actor.solverIndices.Length; ++i)
{
Debug.Log(solver.positions[actor.solverIndices[i]]);
}