1
\$\begingroup\$

I'm trying to find a way to make an object inflated/deflated in Unity, So I can change parameters via script and control a range of 0-100% inflation.

Example planet Earth balloon

I have seen that there is a way to get this exact effect on Blender (it's in the pressure module), but as far as I understand, there is no option to get the same parameters in Unity and actually make them scriptable.

My whole game is based on this feature and I must find a way to achieve that effect.

Any help would be appreciated!

Thank you in advance, Omer

\$\endgroup\$
4
  • \$\begingroup\$ how fine is the control you need? this could make difference answers if for example you would need to control it in 0.1% steps compared to 10-20% at a time. You could always export the model in with different animation states, youtube has some examples like youtube.com/watch?v=h7J8aaUyjmA \$\endgroup\$
    – Zibelas
    Oct 9, 2020 at 11:11
  • \$\begingroup\$ Thank you! Basically, the ideal solution would be to control it in the smallest scale possible in order to make it realistic. If there's no "ideal" solution, I'll probably look for the optimal one, which in this case sounds like it'll be exporting few different inflation states, from low to high, as you said, if I understood correctly. \$\endgroup\$ Oct 9, 2020 at 11:18
  • \$\begingroup\$ Depending on the type of object, you could have just one base model sphere exported from blender and just a lot of different textures for your object. Keep in mind that the human mind can't really differ between small changes. I personally can't even say if a beach ball is 50% filled or 75% filled, you notice the first few % and the last few, but anything in the middle is a mess. You might want a few more fine steps at the start and end and just blend the middle. \$\endgroup\$
    – Zibelas
    Oct 9, 2020 at 11:34
  • \$\begingroup\$ you can try Flex as well: assetstore.unity.com/packages/tools/physics/… \$\endgroup\$ Nov 8, 2020 at 14:25

1 Answer 1

1
\$\begingroup\$

The best solution for your problem is to use blend-shapes (called Shape Keys in Blender) and export those along in the FBX. With Blender, there are a few known issues exporting blend-shapes, so you have to be prepared to give it a few tries.

Once you have that, just set up in Unity to use blend-shapes and you are ready to go.

\$\endgroup\$
3
  • \$\begingroup\$ A vertex shader might be a good way to go too. Bake the inflated positions/normals of the vertices into a texture coordinate channel, then export the deflated mesh. In the vertex shader, blend between the vertex position and the inflated position stored in the texture coordinate according to the inflation level. \$\endgroup\$
    – DMGregory
    Oct 9, 2020 at 12:57
  • \$\begingroup\$ Yes, but it's a very raw approach if you ask me, and it would break the conceptual separation of roles between modellers/animators and coders. The high-level approach (blend-shapes) guarantees independence between each step in the production pipeline and a clean animation adjustment flow for managing change requests. \$\endgroup\$ Oct 9, 2020 at 13:35
  • \$\begingroup\$ Thank you very much! I'll try to utilize it using the blend-shapes. \$\endgroup\$ Oct 9, 2020 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .