If you wanted to use the physics engine to place objects in the world, so rolling rocks down a hill to arrive at a natural positioning, or tilting a room so that the furniture bundles up against one wall… how would you go about doing this?
Depending on what modeler you’re using, you may be able to do this directly in it. If not, it’s possible to do it in unity but it’s not the greatest idea.
I believe that BTM is referring to the collider system in Unity. For accurate physics, not so good in Unity. Compiling basic shape colliders to get a good general physics shape is possible. Do not use the mesh collider. Far to resource intensive for real time moving physics objects.
So if it’s possible to do it in Unity, to say, furnish a room, then tilt it on an angle, then let the physics act… and then somehow save the positioning of the furnishings… how would you do this?
I’m not familiar with how to save the results. I think in Unity it would be more or less letting the physics run each time the room is loaded to have the objects move to the right spot. The human eye is easily fooled, you could probably hand place all the furniture and so long as its not crazy, most people would believe it without a second thought.
I’ve thrown together a few scripts that will help you save the runtime position and rotation of objects in your scene.
The attached example is a very simple physics simulation. You’ll find a ChangeTracker script attached to the cube, and a “Change Tracker” item in the main menu.
Run the game in the normal way. The cube should fall onto the plane. Then instead of clicking the stop button, click “Change Tracker/Preserve Changes” from the main menu. This will stop the game, but the changes to the position and rotation of the cube will be preserved.
Changes can be preserved for any objects that have a ChangeTracker component attached. You can specify what changes are preserved by checking or unchecking the appropriate options on the component.
Hope it helps. ![]()
334584–11753–$editorsave_176.zip (1.02 MB)
Incredibly fantastic. Made my day.
Really cool. Thank you.
If you ever need some art assets made just say the word…