Obi Official Forum
2D softbody physics example - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html)
+--- Thread: 2D softbody physics example (/thread-920.html)



2D softbody physics example - tunageXD - 20-02-2019

I wish to integrate softbody physics into my project using 2d sprites and 2d colliders.

For example I want softbody physics on a 2d sprite that will deform when 2d sprite projectiles collide with it. Would I need to convert all of these sprites to skinned mesh? If so what would be the best way to achieve this?

I cannot find any applicable documentation or example of how to achieve this.

Any help would be greatly appreciated!


RE: 2D softbody physics example - josemendez - 21-02-2019

(20-02-2019, 05:04 PM)tunageXD Wrote: I wish to integrate softbody physics into my project using 2d sprites and 2d colliders.

For example I want softbody physics on a 2d sprite that will deform when 2d sprite projectiles collide with it. Would I need to convert all of these sprites to skinned mesh? If so what would be the best way to achieve this?

I cannot find any applicable documentation or example of how to achieve this.

Any help would be greatly appreciated!

Hi,

Sprites deformation is not supported out of the box. Only SkinnedMeshRenderers are currently supported. You could however do this yourself by getting particle positions at the end of each timestep and deforming a 2D sprite mesh directly, or use a planar (flat) mesh together with a skinned mesh renderer.


RE: 2D softbody physics example - PuppyPuppyPuppy - 01-04-2019

(21-02-2019, 10:09 AM)josemendez Wrote: Hi,

Sprites deformation is not supported out of the box. Only SkinnedMeshRenderers are currently supported. You could however do this yourself by getting particle positions at the end of each timestep and deforming a 2D sprite mesh directly, or use a planar (flat) mesh together with a skinned mesh renderer.

I'm just getting onto this forum as I'm considering getting this asset for my own project.  This was one of the questions that I had.  It did, in a roundabout manner, answer my question and perhaps I can elaborate on the issue.

The easiest way I can think of to convert a sprite to a skinned mesh renderer is to use either Anima2D or Unity's new sprite animation package.  I'm not sure if the latter is still in preview or not.  Either way, both are free and give a really easy way to convert the sprite to a skinned mesh with little effort.  The skeleton functions on both would just be a bonus.

Given this, would the soft bodies interact with 2D physics or would we need to use 3D physics on the non-softbody objects?