Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Debugging the difference between editor and build behavior
#2
(02-09-2020, 07:14 PM)protomenace Wrote: I have a setup with a rope dynamically connected at either end to two rigidbodies. I've managed to tune the masses of the rope and the bodies to my liking, and when I enter play mode in the editor everything works as expected. The rope and its connected bodies areĀ stable at rest on the ground, and I can pick up either body and move everything around, and it behaves nicely.

However, when I create a build (Windows, x86_64, IL2CPP, Unity 2019.4.8f) and run the same scene, the rope absolutely freaks out. My dynamic bodies go flying through the world at thousands of meters per second as the rope spasms wildly.

What kind of things should I be looking at to try to debug this difference in behavior between the editor and a build? Could it be framerate dependent somehow? Are there some build settings I should be cognizant of that Obi is particularly sensitive to?

Off the top of my head: make sure your rope is not attached inside the two rigidbodies, if it's set to collide with them. This is a very common mistake thatĀ  results in largely undefined behavior: might work fine, might jitter/explode. Usually it's the latter.

The reason for this is that attaching particles inside a body they must collide with is an impossible to solve situation: should the particle follow the attachment and stay inside the collider, or should it ignore the attachment and get out of the collider? both conditions can't be met at once, so this creates a force feedback loop: forces are applied to both the rope and the rigidbody so that they stop colliding, but the attachment brings the rope back in, so even more force is applied to both...you get the idea.

The manual describes this situation along with its solution: use phases to make sure the particles attached inside the rigidbody do not collide with it. See the last bit of:
http://obi.virtualmethodstudio.com/tutor...aints.html
Reply


Messages In This Thread
RE: Debugging the difference between editor and build behavior - by josemendez - 02-09-2020, 07:35 PM