Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tons of problems trying to simulate simple rope without elasticity
#29
(11-04-2022, 07:53 AM)josemendez Wrote: According to your profiler, FixedUpdate() is being called 50 times per frame. Normally it would be called 0-1 times. So this means your game is doing x50 the amount of physics work per frame it should do.

This means: your code is running extremely slow, your timestep settings are way off, or both.

You'll get sluggish performance if there's any kind of debugging mode enabled. Either deep debugging or the jobs debugger will make all code in your game run really slow.

Your timestep settings may be an issue too. Make sure your maximum fixed timestep is not some huge value, it should usually be a small multiple of the fixed timestep. Eg; for a fixed timestep of 0.02, use a maximum fixed timestep of 0.04, 0.06, or 0.08. These settings can be found in Unity's Time options (Project Settings->Time)

The only changes I made set timestep from 0.02 to 0.01 as you recomended before for proper Rope simulation.
I disabled Jobs Debugger, and profiler deep profiling switched off.

The result on timestep 0.01 here. How you may see, there are 50 calls at the beginning and it falls to 20 after some 5 seconds.

The result on timestep 0.02 here. It runs much beter after 5 seconds, but at the beginning there is a huge spike still. 

To keep the rope behaviour realistic I need to keep timestep 0.01. That just didn't work better on higher values. But.. the weird think that scene was completed and tested on the devices about a month ago, and everything was ok there. Since that time I have updated Unity version from 2021.2.7 to 2021.2.17. Nothing else was changed.

Of course, I tried to disable Rope on the scene at all to eliminate the issue, and without ObiRope everything is smooth even on 0.01
Reply


Messages In This Thread
RE: Tons of problems trying to simulate simple rope without elasticity - by Romahaaa - 11-04-2022, 10:21 AM