Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2D Softbody skinning problem
#1
Hello,

I'm trying to use a 3D mesh in 2D simulation mode.

 
When I start the game with ObiSolver in 2D mode, the mesh looks not correct. However, if I hot switch to 3D mode (with the same blueprint and other settings), the mesh looks just fine. But I need it to be in 2D.

Is there a way to fix this?

Some more info:
-I made volume blueprint using 3D mesh as source mesh, but I set Z scale to zero, so the particles grid looks flat, as it should be I think.
-Using "4 Bones" in Skin Weights in Unity Quality Settings
-Attached the screenshots of character in 2D mode, in 3D mode, blueprint setup, and mesh with ObiParticleRenderer enabled.
-I used different settings in ObiSoftbodySkinner, but the result is always screwed. Current settings is: Falloff = 1, Max Distance = 3

Thank you very much in advance.

               
Reply
#2
It seems that volume blueprint generated incorrect orientations and restOrientations for my mesh.

In ObiSoftbodyVolumeBlueprint Initialize() method (line 98) I changed 

Code:
Quaternion orientation =  Quaternion.LookRotation(normals[i]);

to

Code:
Quaternion orientation =  Quaternion.Euler(0, 180, 0);
and now it works good for me.
Reply
#3
Hi there!

Since you generated your blueprint from a scaled, "flat" version of your mesh, mesh normals (which are used to orient the particles) still point in their original directions, as we do not transform them when generating the blueprint. You would want them to point directly straight out of the 2D plane, which is exactly what your modification achieves. Glad you figured it out! Sonrisa

Note: using an actual flat mesh as the source would have worked, btw.
Reply