Search Unity

Abacus Physics problem

Discussion in 'Editor & General Support' started by chishti, May 13, 2013.

  1. chishti

    chishti

    Joined:
    May 21, 2009
    Posts:
    188
    Hi,

    I am making an abacus in my project and I am doing my physics settings on ball for abacus in attached image BallInspector.png.

    Balls Image

    https://dl.dropboxusercontent.com/u/6355240/Abacus.png

    Ball Inspector Settings

    https://dl.dropboxusercontent.com/u/6355240/BallInspector.png

    I am only allowing object to move in x direction only, and I am moving my balls like this

    Code (csharp):
    1.  
    2. Vector3 vect = GUICamera.ScreenToWorldPoint(new Vector3(drag.position.x, Screen.height*0.1f, 1.7f));
    3. currDraggObject.rigidbody.position = vect;
    4.  
    I am not moving it using transform.position.

    It works some times fine.. but some times balls get into each other.... any thing I am doing wrong?

    thanks

    chishti
     

    Attached Files:

    Last edited: May 19, 2013
  2. chishti

    chishti

    Joined:
    May 21, 2009
    Posts:
    188
    In the same way I have 2 square in my project
    $Squars.png

    and their physics settings in inspector are
    $SquarsInspector.png

    and I am moving them using statement

    currDragObject.rigidbody.MovePosition(Camera.main.ScreenToWorldPoint (new Vector3 (drag.position.x, drag.position.y, 1.8f)));

    They collide fine. but some times they get into each other... the collision is not smooth.

    thanks
    chishti
     
    Last edited: May 15, 2013
  3. chishti

    chishti

    Joined:
    May 21, 2009
    Posts:
    188
    any one?
    what's the best way to setup an abacus with colliders?