Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Obi adding huge forces to rigidbodies when you delete ropes... (Repro project)
#1
Exclamación 
So, this time I found that when you delete ropes, it can cause NaNs and absurd velocity assignments to rigidbodies when you destroy a rope's GameObject.

The repro package can be found here: (Expires in 30 days)
https://ufile.io/45i4log9

To reproduce:
  1. Start a new Unity project (I'm using 2020.2.0f1).
  2. Add Burst (version 1.4.8) and Jobs (version 0.8.0-preview.23) through the Package Manager.
  3. Import the package linked above.
  4. Open SampleScene.unity and press Play.
  5. Click and drag to attach a rope. The point where you click (mouse down) will be the first point where a rope gets attached. The point where you let go (mouse up) will be the second point where a rope gets attached. Add several ropes.
  6. Press [R] to delete all of the ropes you created.
  7. Repeat 4 and 5 until the bug is reproduced.
You'll see this when you reproduce the bug:
  • The rigidbodies in the scene may start behaving abnormally, with ghost forces pushing them around even though all of the ropes have been removed.
  • You'll see errors spamming the console regarding invalid forces being applied to one or more of the rigidbodies. For example: rigidbody.velocity assign attempt for 'Floating Platform' is not valid. Input velocity is { 2.468001, NaN, 55.692116 }.
  • Some of the rigidbodies may explode into outer space from the absurd forces.
Seems related to the previous bug I posted, with very similar symptoms.

Other symptoms I've noticed in fighting with this bug:
  • When I start SampleScene with a rope in the scene already, (drag ObiPrefabs/Rope into the scene and activate the GameObject before pressing play) any ropes you add to the scene will be frozen and will not simulate.
  • After reproducing the above bug: When switching to the scene "RopeNet" (which uses a modified example script to use the global solver), pressing play, and then unpressing play, the console will spam about some phantom Obi.ObiLateFixedUpdater trying to poke at various destroyed Obi components. When this occurs, you'll find that there are no ObiLateFixedUpdater instances visible in the hierarchy.
Code modifications to note:
  • ObiStatic.cs added, which enables a global solver.
  • ObiStaticSettings.cs added, which allows you to define the global solver using a prefab reference.
  • When an ObiRope is created, it will check for a solver in one of its ancestors. If one isn't found, it'll use ObiStatic.WorldSolver, which will get instantiated if needed.
  • RopeNet.cs will use ObiStatic.WorldSolver instead of creating its own solver.
Reply


Messages In This Thread
Obi adding huge forces to rigidbodies when you delete ropes... (Repro project) - by Hatchling - 19-05-2021, 04:49 PM