Search Unity

Using Physics to Place Gameobjects

Discussion in 'Physics' started by mdcarso, Dec 26, 2014.

  1. mdcarso

    mdcarso

    Joined:
    Oct 25, 2013
    Posts:
    1
    Q: I would like to place a number of prefab objects in a scene, play the scene, and have the physics engine resolve their final resting position on a plane. Is there a script that will retain each objects transform after I press stop. I like to use physics to randomly position objects, ie like ice cubes in a glass or matchsticks in pile.

    Any help would be appreciated.
     
  2. TiG

    TiG

    Joined:
    Feb 28, 2011
    Posts:
    308
    There are some ways to do this. You can either remove the rigidbodies of the objects or make them kinematic, or simply stop them by decreasing their velocities to zero.
     
  3. SeasiaInfotechind

    SeasiaInfotechind

    Joined:
    Nov 17, 2014
    Posts:
    32
    Hello ,
    You can do this by make gameobjects static or make them kinematic.
    Looking forward to your reply.
    Thanks