How do I make a softbody jello sphere with NVIDIA FleX in Unity3D?

838 views Asked by At

I am currently using the NVIDIA FleX package in Unity3D to create soft-bodied, jelly objects. I'm using Unity for animation only, not game dev.

What I am aiming to make is a transparent, jello sphere that retains its spherical shape with elasticity.

The first way I've tried to achieve this is using Flex Array + fluid setting. I've been playing with the settings but I can't get it to remain a sphere, it just becomes a more/less viscous fluid blob.

The second way is using the Flex Soft + fluid setting. It is much better in terms of physics but even with "draw particles" off, but the water droplets are each separated and not one jelly sphere.

This is what it looks like before hitting play, where the left is with Flex Array and the right is Flex Soft. The particles for Array are visible but not for Soft. This is after hitting play, where the Array becomes one viscous fluid, but not a sphere, and the Soft is very jello-like but the water droplets are all separated.

A solution for either of the two ways would be much appreciated!

1

There are 1 answers

0
gruffy321 On

the standard approach is to create an Nvidia Flex Controller first... Add flex container

Then you should also create a Flex Soft Asset... Add flex soft asset

Then you should create or select a game object and through the Add Component tab in the game object's inspector, find the Flex Soft Actor component [see it loaded up in the image below]...

enter image description here

Ensure your Soft Actor Asset mentioned previously has your required mesh type selected in the inspector option [I chose sphere in the image here] and check to see it looks something like the image below to be sure...

Add Flex soft actor component to game object

So after that, hopefully, you can just press play and see it in action as it drops and contorts for you.

If not, I have created a quick example for you to download as a unitypackage.

It may still require further resolution with the package manager as the Flex plugin is already inside the package I'm providing here[Using Unity 2020.3.5f1] Flex in unity package

Anyway, hope this gets you started and somewhere towards your goal with Flex. As a bonus, I've added a small script to move the flex object as this is outside of the usual approach as we have to call to the NVidia Flex component class of choice and invoke the ApplyImpulse method.

Cheers :)

Edit: There are a small 3 set of tutorials from NV Gameworks on integrating the plugin with Unity and exampling some stuff - this "stuff" is included in my downloadable package provided above. Here is the youtube link to the 3 set:

Nvidia Gameworks FleX tutorials on Youtube

Edit 2: rereading your question made me think I hadnt really given you the definitive answer as to using a cloth actor and having the mesh renderer deform via the flex cloth deform component. I am providing another link to another unity package here that will show this in action also allowing you to see the game object and how the cloth component from NVIDIA Flex works with the standard mesh filter and mesh renderer. Hope this more accurately answers your question :) Example also using Cloth Actors as well as Soft Actors in NVIDIA FleX