How can I set a static mesh's position after physics simulation?

I am playing with RealisticRendering example, I just made a blueprint that creates a book affected by physics. I want to make it look like someone has trashed whole room. I would like to place books where they fall after starting playing level, and them leave them there statically.

How can I set their position after simulation has started?

Hey sergio,

There isn’t an easy way to set a new position for an Actor after Simulating. best you can do is Simulate, let everything fall, and then make note of each Actor’s Transform values. Then you’ll need to set each individually. I believe developers are looking into a better way of handling this.

Another way to do this is in Play. Set a Blueprint to spawn each Actor you want to drop, and make a Blueprint for those Actors. When Actor hits, give it a short delay to account for it finding its final position, and then spawn a new Blueprint using same Static Mesh, this one set to Static mobility. Then Destroy initial Actor. It might look something like this:

It’s not easiest solution, but as long as this occurs before player sees it, it can work well. Unfortunately it isn’t possible to set mobility of an Actor during Play. You can set it in Constructor, but that wouldn’t work if you want it to fall into position first. That’s why you’d want to replace movable Actor with same one with same transform but set to Static mobility.

Hope that helps!

Awesome answer. I might go with option 1, there aren’t many assets for which I want to simulate physics. I think it’d be a nice feature. For cloth meshes or so to turn into static would be a nice thing related to this.

Actually, you can copy full state from simulation world to editor world by using right click context menu on actor and choosing “Keep Simulation Changes” (hotkey bound to K).

Cheers,
Noland

Just a note, this doesn’t work for Physics Constraint actors.

For posterity’s sake: At this time, choosing “Keep simulation changes” does work (I’m currently using UE4 v.4.14.3) and is most likely best and most straightforward way to simulate Physics Constraint actors, let them fall into place, and then keep that initial state for your level.