Precomputing physics simulations

Undoubted this question has come up before, but is there a way to precompute physics simulations from inside the editor, so that all simulations don’t have to begin at runtime? The classic example would be a flag that will be visible at the start of the game- it needs to wave in the wind, but it should start already hanging downwards by the force of gravity.

Thanks!
Orion

No there is no way to precompute physics at all, neither in the editor nor at runtime.

A flag though could easily be done through a simple shader, I recall that at least one of them was shared here and/or the unifycommunity, as thats trivial vertex shader + sin deformation

You can set the time scale for physics (fixedupdate) quite high - ie 10x normal speed, and yield a few times before the game starts to precompute several frames ahead. This should be fine for general purpose physics. Assuming you would show your loading screen a couple seconds extra.

You’re able to change how fast unity is running in time, and this affects physics as well.

This is quite poor. There are lots of situations (especially) on low end platforms where this is desirable - in fact I need it right now.

Yes a flag is simple to simulate without phyiscs.

I’ll let you know how I go.

I just told you how you can precompute physics though.

You can compress physics as much as you like by temporarily changing fixedupdate rate to a much faster value, waiting a bit then starting.

If you’re wanting to do it without the one second delay before you can play, you can save them like that and load them.