Go back to documentation on product:
<aside> đź’ˇ If you want to have a Zibra Liquid instance pre-filled on startup you will need to use Initial State baking.
After baking, the Zibra Liquid instance will remember its initial state and will start simulation from it. Note that we do not support baking animation, simulation over time, etc. Simulation itself is always performed on the device in real time, only the initial state is baked.
Initial State Baking will simulate the first N seconds of your liquid instance, save it, and simulation in play mode will start from that point.
Note that after changing some parameters you’ll have to rebake your liquid, specifically: Grid Resolution, Container Size (in case you changed the size non-uniformly, and as a result changed the Effective grid resolution), Max particle count (in case your baked state has more particles that the current max number).
</aside>
To bake initial state:
If you haven’t already, add all emitters, voids, and colliders that you are going to have to your liquid.
Open the baking utility and select your Zibra Liquid instance to bake.
Open the Zibra Liquid Inspector and set Initial State to “Baked Liquid State”.
Press “Open Zibra Liquid Baking Utility”
Now you see the Baking Utility window
Set the Simulation time to the number of seconds you want to simulate.
(optional) If you want to run a baking simulation with specific timestamp, you can disable “Use project fixed timestep” and set your desired “Simulation timestep”
Press “Run Simulation”. You’ll see the simulation running in Scene/Game view (only Game view on URP)
(optional) If you want to run the simulation further, set the Simulation time to the amount of time you want to run simulation forward, and press “Run Simulation Forward”.
(optional) If you simulated too far, and want to start over, press “Stop” and go back to step 4
Press “Save new state” to save baked state.
That will save the new state to the file in the subdirectory next to your scene file. e.g. for Liquid Instance “ZibraLiquid1” in “/Assets/NewScene.unity” scene, liquid baked state will be saved into “/Assets/NewScene/” folder as “ZibraLiquid1BakedState.bytes”.
9.1. If you already had a previous saved state you’ll have 2 buttons: “Save new state” and “Overwrite existing state”.
9.2. “Save new state” creates a new file, while “Overwrite existing state” overwrites the old file with a new state.
(optional) After you are done with baking, press “Stop” to stop the liquid simulation and unlock the parameters that are disabled when the liquid is “live”. Next time you’ll change a scene or enter playmode this state will reset, so you usually don’t need to manually stop it.