Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Resetting Rope causing Error
#6
(07-08-2024, 09:38 AM)josemendez Wrote: The key thing to keep in mind is that the amount of particles in the blueprint and the amount of particles in the current rope may be different, if you're resizing the rope before calling ResetParticles().

Say you have 10 particles in the blueprint. You instantiate a rope using this blueprint, then increase its length so that it has 15 particles. After that you call ResetParticles(): this will set the position/orientation/velocity of the first 10 particles to match the blueprint, but will leave the extra 5 particles alone. It won't reset the length of the rope to what it previously was - won't destroy/add particles, constraints or elements.

As long as your logic takes this into account it will be fine.

kind regards,

Thanks, and if i resize it after calling ResetParticles() then it will delete the other 5 right?

What could be an OBI7 solution to?

Quote:public void ResetRope()
    {
        rope.RemoveFromSolver();
        rope.ClearState();
        rope.AddToSolver();
        ropeCursor.ChangeLength(initialLength - rope.restLength);
    }

that resets the rope and constraints everything to bring it back to initial state fully?
Reply


Messages In This Thread
Resetting Rope causing Error - by vrtraining - 06-08-2024, 06:33 PM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 07:13 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 08:06 AM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 08:47 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 09:38 AM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 09:40 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 10:20 AM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 10:45 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 11:53 AM
RE: Resetting Rope causing Error - by josemendez - 07-08-2024, 12:15 PM
RE: Resetting Rope causing Error - by vrtraining - 07-08-2024, 12:50 PM