Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fast Forward Rope Simulation
#1
We have a crane hook system with ropes. At the start crane is at rest position and all ropes and hooks fall in straight line due to gravity so we have defined our ropes blue print similar to that, so as soon as Unity scene is started ropes don't show any animation as their blue prints are aligned with same rest pose of the crane. Like shown in image A below

[Image: A.png]


Now in some cases crane needs to start as some lifted height and angle. But as soon as the scene start rope fall down due to gravy and swing for few seconds. As shown in image B below, is there any way that we skip those first initial steps that includes swinging of ropes and they start instantly in straight line.

[Image: B.png]

We want the desired result like image C below (which comes after few seconds as rope settles itself due to gravity). We can't use a different blue print since we dont know how many different crane starting positions can be, so we can't create a new blue print for each setup. Is there any way to fast forward or skip some steps. We want to somehow skip the initial swing of ropes and look like below

[Image: C.png]
Reply
#2
You can modify ObiFixedUpdater* with a custom fixedDeltaTime, to try 2x or 5x the value.
Then fast-forward until all particle velocities are below some epsilon?

You could also save Positions and Velocities in text files, as opposed to new Rope Blueprints.

*In my case, I need Fluid Emitter particles to exist immediately after the Emitter is spawned, so call a FixedUpdate there.


Attached Files Thumbnail(s)
   
Reply
#3
(09-12-2023, 02:30 AM)slimedev Wrote: You can modify ObiFixedUpdater* with a custom fixedDeltaTime, to try 2x or 5x the value.
Then fast-forward until all particle velocities are below some epsilon?

You could also save Positions and Velocities in text files, as opposed to new Rope Blueprints.

*In my case, I need Fluid Emitter particles to exist immediately after the Emitter is spawned, so call a FixedUpdate there.

ObiFixedUpdater is called independently from FixedUpdate in unity?
Reply
#4
(09-12-2023, 01:41 PM)vrtraining Wrote: ObiFixedUpdater is called independently from FixedUpdate in unity?

Hi!

Not sure what you mean by “independently”. ObiFixedUpdater is a component that ticks the simulation during FixedUpdate(). So in that sense no, it’s not independent from Unity’s FixedUpdate.

Keep in mind that FixedUpdate is simply called by Unity at a fixed interval, which just also happens to be right before Unity updates its own physics engine. If you want to “fast-forward” both rigidbody and rope simulations, you need to advance both Unity’s own physics as well as all solvers in ObiFixedUpdater.

Kind regards,
Reply
#5
(09-12-2023, 01:41 PM)vrtraining Wrote: ObiFixedUpdater is called independently from FixedUpdate in unity?

The screenshot is of my modified ObiFixedUpdater.cs, not the default
It would let you pass in exaggerated timestep values from your own script for the Fast Forward affect


Here is the bool I added, to disable the default FixedUpdate()


Attached Files Thumbnail(s)
   
Reply