Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Runtime repin rope to new controll point
#2
Code:
for (int i = 0; i < blueprint.activeParticleCount; i++)
{
rope.TeleportParticle(rope.solverIndices[i], GetSolverLocalPos(hooks[GetLastHookIndex].transform.position));
rope.solver.velocities[i] = Vector4.zero;
rope.solver.angularVelocities[i] = Vector4.zero;
}

This will place all particles in the rope at the exact same position, essentially collapsing the rope in to a point. I guess this is not what you want in this particular case. Not sure what the intent is?


When adding the new pin constraint to point C, you set the amount of active constraints to 2, despite only adding 1:
Code:
batch.activeConstraintCount = 2;

Does that batch already contain a constraint that you also want active?

Other than this, the code looks ok to me.
Reply


Messages In This Thread
RE: Runtime repin rope to new controll point - by josemendez - 31-05-2021, 08:26 AM