API explanation
density is multiplied by the area of the body’s shape to determine its mass. This parameter is based on a standard value of 1.0 for water, so materials that are lighter than water (such as wood) have a density below 1.0, and heavier materials (such as stone) have a density greater than 1.0. However, feel free to set density values to whatever feels right for your game, since overall object behavior will also depend on your gravity and pixels-to-meter scale settings (see previous section). The default value is 1.0.
i have tried different way to set mass for crate with same size
here my code
physics.setGravity(0, 9.8)
physics.addBody(crateObj, “dynamic”, {density=3000.0, friction=0.5, bounce=0.3 } )
physics.addBody(groundObj, “static”, { friction=0.5, bounce=0.3 } )
i found it no diff with
physics.setGravity(0, 9.8)
physics.addBody(crateObj, “dynamic”, {density=3.0, friction=0.5, bounce=0.3 } )
physics.addBody(groundObj, “static”, { friction=0.5, bounce=0.3 } )
what should be the correct code to make the drop speed diff? (diff mass i mean)
Thanks! [import]uid: 10373 topic_id: 3626 reply_id: 303626[/import]
