Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Mesh Flies away on Simulation
#4
(08-12-2021, 05:44 PM)Biggerest Wrote: Hi!

Thanks for the assistance for the obiupdater I definitely was unaware of what I was completely doing exactly so I referred to the obiupdaters and what you have mentioned and updated my updater and now it does seem to run better however unfortunately the original problem still persists. 

Would you have any other idea to what else it might be? 

Hi!

If the mesh is still flying away, maybe there's a scale mismatch between the blueprint and the cloth transform? What's are scale values of your cloth transform?


Regarding your current code: I don't think you need a custom updater for your purposes. You seem to be confusing the amount of un-simulated game time (which is what the updater keeps track of) with the net amount of time simulated since the start of the simulation. These are two completely different things.

This:
Quote:if (_currentSimulationTime >= _simulateTime)
            {
                isSimulating = false;
                return;
            }

Will not stop the simulation once you've simulated more than _simulateTime, since _currentSimulationTime is the amount of time that has passed in the game but has not yet been simulated by the physics engine.

This value will never be larger than Time.deltaTime, since Unity will call FixedUpdate() multiple times per frame as long as _currentSimulationTime is larger or equal to Time.fixedDeltaTime. If you're unsure how FixedUpdate() works, please refer to Unity's manual.

If you want to keep track of the time passed since simulation and then stop simulating, you can just keep track of it manually (by accumulating Time.deltaTime) and then disabling the updater component once it's larger than _simulateTime. Using the default ObiFixedUpdater will work just fine for this.

kind regards,
Reply


Messages In This Thread
Mesh Flies away on Simulation - by Biggerest - 05-12-2021, 07:48 PM
RE: Mesh Flies away on Simulation - by josemendez - 06-12-2021, 11:15 AM
RE: Mesh Flies away on Simulation - by Biggerest - 08-12-2021, 05:44 PM
RE: Mesh Flies away on Simulation - by josemendez - 10-12-2021, 09:42 AM