Download

Use Physics Simulation to Save Time Level Building

You want a crate full of apples in your level, but your artist has only created an open wooden crate and a static mesh apple. Generally you have two options to solve this problem. Ask your artist to create a crate full of apples and send you an additional asset or you could manually place each apple with unique rotations to fill the crate. Fortunately we can use physics simulations to create this for you very quickly.

Add multiple box collisions to allow objects to fit inside of the crate:

Add a sphere collision to your apple:

Prepare your apples above your wooden crate (don’t worry about rotation or spacing between them):

Select all of your apples and make sure to check ‘simulate physics’:

Go ahead and simulate your scene:

While your scene is still simulating (and apples have come to rest) select all of your apples in the world outliner or the viewport and hit the ‘K’ key. This will save their locations and rotations. You can now stop the simulation.

After you have done this you will want to navigate to the Merge Actors window:

Now that this window is available to you, you’ll want to select all of the apples inside of the crate and click the merge actors button:

If you checked the replace actors box your physics apples will now be replaced with the static mesh group of apples:

You’ll want to attach your apples to your crate to make moving them around easier:

You should now have a lovely box of apples that you can reuse anywhere in your level!

This is great advice, and is one of the first things I started doing when I used the engine for the first time!

That is really handy to know. Thank you.

why my upvote button doesnt work? great!

Thanks for the tut.

I tried this the other day, but for for some reason the location and rotation isnt copied over for any sort of blueprint actors simulating physics.

awesome! thx a lot!

But doesn’t that mean you’d have unnecessary apples (polygons) that the user can’t even see? Instead of creating just the top layer of the apples, to give the illusion.

Sure it doesn’t matter if you just place one apple, but if you want to fill a lot of boxes or large pools this way, I imagine it to be rather performance negative?

True, so it depends on the use-case. If you want a crate of dynamic apples, this would be the best solution. If you want a pile of books on a floor, this could be handy. If you want a 2D non-dynamic crate, this would not be the best.

Just another tool that might be useful :slight_smile:

No idea why this is the case, but static mesh components seem to be unable to retain the simulated changes.

I’m going to try this out today, looks cool!