Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Rope Jitter In Editor But Not In Build
#1
Hi,

I noticed when I add force to a particle it seems to jitter a lot in the editor but in the build, it is completely smooth.

Editor:
[Image: qEZ9fu2.gif]

Build:
[Image: zieaHSQ.gif]

I have an older version of this project running Obi 5 on Unity 2019 and it doesn't seem to be having this issue. 

Edit:
It seems to be an issue with the ropes mass. I know if it's low enough it will produce unwanted effects. The control points on the rope are all set to 0.05 for the mass and the rope.GetMass() is 0.6. Whereas in the older version I mentioned above, even though the rope had the same control points with the same mass given to each one, its total mass was 1.55.
Reply
#2
Hi!

(30-03-2022, 03:45 AM)VirtualCucumber Wrote: It seems to be an issue with the ropes mass.

Mass is the same both in editor and in builds, so there's very little chance it has anything to do with the issue.

(30-03-2022, 03:45 AM)VirtualCucumber Wrote: I know if it's low enough it will produce unwanted effects.

Not really. Mass values can be as low or as high as you need. What's problematic is the mass ratio between objects (objects of wildly different mass values interacting with each other). If you had two 1000 kg objects interacting, you'd get the exact same result if they both had 0.001 kg. Problems would appear if one weighted 1000kg and the other one 0.001 kg, though.

In your case you're applying a force -which is acceleration times mass-, so if the mass is low the resulting acceleration will be high but shouldn't cause stability issues/jittering since it isn't interacting with anything (not colliding against or dynamically constrained to other object).

(30-03-2022, 03:45 AM)VirtualCucumber Wrote: The control points on the rope are all set to 0.05 for the mass and the rope.GetMass() is 0.6. Whereas in the older version I mentioned above, even though the rope had the same control points with the same mass given to each one, its total mass was 1.55.

The mass of the entire rope is the sum of the mass of all its individual particles. So total rope mass doesn't depend on the amount of control points, and it's not only determined by the mass values set in these control points but also by resolution: Higher resolution = More particles = More mass. Maybe the ropes had slightly different resolution?

Will try to reproduce this using the latest version I have of the project and get back to you asap. cheers!
Reply
#3
Tried the latest version of the project that I have, but its behavior in a standalone build is identical to the editor (tried them side by side). Can't reproduce any jittering.

Out of curiosity took a look at the code in your Hand.AddForce() method:

Code:
float mass = _arm.GetMass(out com);
bodyForce /= mass;
Solver.externalForces[SolverIndex] += bodyForce / Solver.invMasses[SolverIndex];

You divide the force by the mass of the entire rope, which gets you an acceleration (dependant on the rope resolution and mass of other particles in the rope). You then divide this acceleration by the inverse mass of the last particle (that is, multiply it by the mass of the last particle), which gives you a much smaller force that depends on rope resolution. Not sure what the intent is here.

Applying a force to the rope at a given particle should be as simple as Solver.externalForces[SolverIndex] += force. This force will be automatically propagated trough the rope.
Reply