Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Can Obi Cloth be paused?
#1
Hello,

I'm a prospective buyer of the Obi Cloth asset, and I'm looking for a certain functionality.  I would like to know if Obi Cloth can be paused/unpaused at runtime, with the mesh holding its exact shape deformation while paused. I am designing a 2D platform game that will require the instant 180-inversion of a cloth's parent object's y-rotation on left/right user inputs (i.e. the character wearing the cloth reflects, rather than smoothly rotating towards the new bearing).  I want to be able to do so mid-animation without the infinite velocity of the movement affecting the cloth.  In other words, all mesh vertices should be able to remain frozen exactly in place when rotated to the opposite angle, and be able to unfreeze and resume the simulation on the next update.

The native Unity Cloth component doesn't seem able to provide such a functionality, and is generally frustrating to work with. At best, I've been able to temporarily dampen the simulation when switching directions.  But even 100% dampening looks and behaves awkwardly with certain animations, as it doesn't freeze the vertices but rather is a coefficient that dampens the effect of the physics motion.  Basically, it doesn't appear to be a iron-clad, all-around solution for my needs. In addition, Unity Cloth does not jibe with my game's pause function, as its simulation persists while all other graphics are paused.

If Obi can help me solve this problem, I am ready to buy today!

Thanks,
Jarod.
Reply
#2
(28-04-2018, 11:37 PM)JayDK Wrote: Hello,

I'm a prospective buyer of the Obi Cloth asset, and I'm looking for a certain functionality.  I would like to know if Obi Cloth can be paused/unpaused at runtime, with the mesh holding its exact shape deformation while paused. I am designing a 2D platform game that will require the instant 180-inversion of a cloth's parent object's y-rotation on left/right user inputs (i.e. the character wearing the cloth reflects, rather than smoothly rotating towards the new bearing).  I want to be able to do so mid-animation without the infinite velocity of the movement affecting the cloth.  In other words, all mesh vertices should be able to remain frozen exactly in place when rotated to the opposite angle, and be able to unfreeze and resume the simulation on the next update.

The native Unity Cloth component doesn't seem able to provide such a functionality, and is generally frustrating to work with. At best, I've been able to temporarily dampen the simulation when switching directions.  But even 100% dampening looks and behaves awkwardly with certain animations, as it doesn't freeze the vertices but rather is a coefficient that dampens the effect of the physics motion.  Basically, it doesn't appear to be a iron-clad, all-around solution for my needs. In addition, Unity Cloth does not jibe with my game's pause function, as its simulation persists while all other graphics are paused.

If Obi can help me solve this problem, I am ready to buy today!

Thanks,
Jarod.

Hi,

You can pause the simulation simply by disabling the ObiSolver component. Then wait until the end of the frame using a coroutine, and re-enable the solver. This is generally used to teleport characters around avoiding unnatural movement of the cloth, which is pretty much your use case (mirroring a character in place)

kind regards,
Reply
#3
(30-04-2018, 08:53 AM)josemendez Wrote: Hi,

You can pause the simulation simply by disabling the ObiSolver component. Then wait until the end of the frame using a coroutine, and re-enable the solver. This is generally used to teleport characters around avoiding unnatural movement of the cloth, which is pretty much your use case (mirroring a character in place)

kind regards,

Thank you for the speedy reply, Jose.

Just to clarify, if I disable the Obi solver until the end of the frame, will the cloth retain its latest deformation for the following frame?  For instance, disabling/enabling the Unity Cloth component using a similar strategy causes the mesh to revert to its original shape before the simulation resumes. This will often cause the cloth meshes to clip through their 180-reflected colliders, essentially breaking the cloth on the next update for many animations. For example, a kneeling or running character that changes direction will have sharp collider angles that will break the plane of a simple, conical skirt mesh when the cloth reenables in its undeformed state.

Is there a video or support thread you can point me to that demonstrates this effect and/or its implementation? Failing that, would you or someone on your team be willing to assist me with implementation after purchase? I just want to be sure before I buy that Obi will fulfill this particular need.

Thanks,
Jarod.
Reply