Bake Cloth to game engine?

Hey, so in my game i will have flags in the background blowing in the air, and i set up a few flags that are realtime cloth sim and ive made them blow in the wind, but. its very memory consuming for no reason. the flags are way up in the air nothing is gonna touch them so realtime physics is unimportaint.

So to save memory is it possible to bake a clot sim and then make animate it in game engine?

I have been wondering this for a while too, but I am not sure how to do it…

Bake your cloth simulation
Enable the .mdd file importer/exporter addon

With the cloth object selected export as a .mdd file
Delete the cloth simulation
Select the flag and import the .mdd file
The flag should now have a number of shapekeys which are keyframed for each frame of the simulation.
You can now set this animation to play in the game engine with an Action actuator


flag_BGE.blend (3.03 MB)

That blend file is pretty kickass but how do you make it play a perfect looping animation. If you set playback style to ping-pong mode you can tell it’s not looping properly.

You need a cloth sim that is loopable.
Make it simple and edit the shapekeys if neccessary

If you are a cgcookie citizen member

Is it possible to have multiple actions instead of using one single dope-sheet animation? Can I assign the animation to an action in the action editor?

how about my t-shirt cloth simulation, is the same way with the flag?