29-03-2020, 06:01 PM
Hi !
I am looking for a way to set a particle position at runtime. I've been stuck on this for quite a long time.
All my ropes are instantiated based on the same prefab and use the same blueprint.
I found a way to set a particle position to a specific position by doing :
This works, but only if I put it in the Update method of my script.
However, only this specific particle is stuck in place, all the other particles stay in the exact same position they were, leaving a huge distance between my first particle and the second one...
But if I set the particle positions in the Start method, once the simulation starts, all the particles just go back to the position same they were supposed to have, including the one I set to another position.
Here is a screenshot of the issue I am trying to describe, I hope that helps.
particle0 is right where I want it but the other particle won't follow :
Is there a way to set the first particle of my rope to a specific position, but still have all the other particles on the rope follow the simulation ? If so, where should the code go ? I am not sure the Update method is the way to go.
Also, I really would like to avoid having to instantiate 40+ blueprints. Is this something I really have to do ?
Thank you in advance to whoever might be able to help me.
I am looking for a way to set a particle position at runtime. I've been stuck on this for quite a long time.
All my ropes are instantiated based on the same prefab and use the same blueprint.
I found a way to set a particle position to a specific position by doing :
Code:
solver.positions[this.rope.solverIndices[solverIndex]] = position;
However, only this specific particle is stuck in place, all the other particles stay in the exact same position they were, leaving a huge distance between my first particle and the second one...
But if I set the particle positions in the Start method, once the simulation starts, all the particles just go back to the position same they were supposed to have, including the one I set to another position.
Here is a screenshot of the issue I am trying to describe, I hope that helps.
particle0 is right where I want it but the other particle won't follow :
Is there a way to set the first particle of my rope to a specific position, but still have all the other particles on the rope follow the simulation ? If so, where should the code go ? I am not sure the Update method is the way to go.
Also, I really would like to avoid having to instantiate 40+ blueprints. Is this something I really have to do ?
Thank you in advance to whoever might be able to help me.