Obi Official Forum

Full Version: Using ObiCloth with 2D objects?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there possible to use ObiCloth with 2D objects? I'm trying to simulate an 2D ball with water inside for my game in Unity3D.
(10-08-2017, 06:21 AM)matchalover Wrote: [ -> ]Is there possible to use ObiCloth with 2D objects? I'm trying to simulate an 2D ball with water inside for my game in Unity3D.

Yes, just set the ObiSolver to 2D mode, and add colliders to the colliders2D list of the ObiGroup instead of the regular collider list.
(11-08-2017, 08:34 AM)josemendez Wrote: [ -> ]Yes, just set the ObiSolver to 2D mode, and add colliders to the colliders2D list of the ObiGroup instead of the regular collider list.

But how can i creat a mesh topology for a 2D object?
(11-08-2017, 03:56 PM)matchalover Wrote: [ -> ]But how can i creat a mesh topology for a 2D object?

Exactly the same way as you do for a 3D object. There's no difference at all between 2D and 3D modes in Unity, besides the camera projection.

Note that you´ll have to use an actual Mesh, as Sprites do not expose an useable mesh (they're either quads or convex polygons, but none of these can be deformed to resemble cloth in a meaningful way)