Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Climbing on rope and fix to move only on x, y
#8
(05-10-2021, 01:22 PM)lacasrac Wrote: This code is working if I have only 1 rope in the solver, but if I put 2 ropes, I get this:

IndexOutOfRangeException: Index was outside the bounds of the array.


var solverIndex = _rope.solverIndices[particleIndex];
_MyScripts.CreateObiRope.GetParticleNeighborIndex (System.Int32 particleIndex, System.Int32 offset) (at Assets/_MyScripts/CreateObiRope.cs:332)
_MyScripts.CreateObiRope.StayOnRope () (at Assets/_MyScripts/CreateObiRope.cs:246)
_MyScripts.CreateObiRope.Climb () (at Assets/_MyScripts/CreateObiRope.cs:224)
_MyScripts.CollideObiRope.Update () (at Assets/_MyScripts/CollideObiRope.cs:76)

You're passing a particle index that's < 0 or larger than the amount of particles in the rope. Make sure you're passing the index of the particle in the rope, not the index of the particle in the solver.
Reply


Messages In This Thread
RE: Climbing on rope and fix to move only on x, y - by josemendez - 05-10-2021, 01:28 PM