Obi Official Forum
Using ObiCloth with 2D objects? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Using ObiCloth with 2D objects? (/thread-70.html)



Using ObiCloth with 2D objects? - matchalover - 10-08-2017

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.


RE: Using ObiCloth with 2D objects? - josemendez - 11-08-2017

(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.


RE: Using ObiCloth with 2D objects? - matchalover - 11-08-2017

(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?


RE: Using ObiCloth with 2D objects? - josemendez - 12-08-2017

(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)