19-02-2021, 11:08 AM
(This post was last modified: 19-02-2021, 11:22 AM by josemendez.)
Hi there!
From the API docs on GetParticlePosition:
Since you're passing the same index to both calls (0), you get the same position, from the same particle.
You should use the following instead:
Note that particle indices come in two flavors: actor indices and solver indices. The first particle in the actor might be particle 237 (or any other) in the solver, depending on how many actors have been instantiated and in what order.
let me know how it goes!
From the API docs on GetParticlePosition:
Quote:Given a solver particle index, returns the position of that particle in world space.
Parameters:
solverIndex Index of the particle in the solver arrays.
Returns:
The position of a given particle in world space.
Since you're passing the same index to both calls (0), you get the same position, from the same particle.
You should use the following instead:
Code:
Debug.Log(cloth1.GetParticlePosition(cloth1.solverIndices[0]));
Debug.Log(cloth2.GetParticlePosition(cloth2.solverIndices[0]));
Note that particle indices come in two flavors: actor indices and solver indices. The first particle in the actor might be particle 237 (or any other) in the solver, depending on how many actors have been instantiated and in what order.
let me know how it goes!