Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Issue with Rope Consistency!
#14
(10-06-2020, 09:09 PM)josemendez Wrote: I don’t think I get it... no matter how the total length of the rope is distributed across particle constraints (some might be very stretched, other not so much), the total rope length is the same. When increasing the length of the rope using a cursor, new constraints will always have the same rest length. This is taken care of automatically, I believe you’re overcomplicating things a lot: just call cursor.ChangeLength(new length) when the value returned by rope.CalculateLength() exceeds the rest length by some threshold. Pseudocode:

float length = rope.CalculateLength();
If (length > rope.restLength + threshold)
cursor.ChangeLength(length);

Thanks for the code, the issue now is that the added particles stay fixed and didn't moves, and the code work for just one or two moves, and after that I got this error: 

IndexOutOfRangeException: Index was outside the bounds of the array.
Obi.ObiActor.SwapWithFirstInactiveParticle (System.Int32 actorIndex) (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:420)
Obi.ObiActor.ActivateParticle (System.Int32 actorIndex) (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:434)
Obi.ObiRopeCursor.AddParticleAt (System.Int32 index) (at Assets/Obi/Scripts/RopeAndRod/Actors/ObiRopeCursor.cs:118)
Obi.ObiRopeCursor.ChangeLength (System.Single newLength) (at Assets/Obi/Scripts/RopeAndRod/Actors/ObiRopeCursor.cs:203)
RopeScript.Update () (at Assets/Scripts/RopeScript.cs:28)

Can you make a quick video on this please, because I'm stuck on this all the day  Triste

Beside that, I think the perfect way to solve my problem -If it were possible- is to increase the number of particles to a higher number, but it's not possible to increase the resolution to more than 1.
Reply


Messages In This Thread
Issue with Rope Consistency! - by Kifwat - 10-06-2020, 02:57 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 03:26 PM
RE: Issue with Rope Consistency! - by Kifwat - 10-06-2020, 04:30 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 04:45 PM
RE: Issue with Rope Consistency! - by Kifwat - 10-06-2020, 05:41 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 05:51 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 06:13 PM
RE: Issue with Rope Consistency! - by Kifwat - 10-06-2020, 06:46 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 08:01 PM
RE: Issue with Rope Consistency! - by Kifwat - 10-06-2020, 08:12 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 08:38 PM
RE: Issue with Rope Consistency! - by Kifwat - 10-06-2020, 08:55 PM
RE: Issue with Rope Consistency! - by josemendez - 10-06-2020, 09:09 PM
RE: Issue with Rope Consistency! - by Kifwat - 10-06-2020, 09:41 PM
RE: Issue with Rope Consistency! - by josemendez - 11-06-2020, 08:13 AM