Mirroring the player in a 2d side scrolling game. [ Similar to Tiny Magnets Game]


     I'm trying to create exact prototype of some 2d games to find out the hardest part in 2d game development, and I hit that part recently. 

      Tiny Magnets - 2d side scrolling game. Available in Android. 

       This game has two gameobjects moving from left to right. One is above the screen.height/2 and other below. When tapped above, the one on the upper half of the screen should jump and vice versa.  Multi touch should work instantly when tapped on both sides of screen and both should jump at the same time..     I've done upto this.

        The square metal boxes(sprites I think) are the obstacles as platform, kept unevenly in which these gameobjets should avoid by jumping.  I've done this too... 
     Problem : when I make both jump , one of the object collides with metal boxes and stops there. Because of that, other stays at the current position.

     Help me out to find this logic, when one stays at x position other needs to stay in its x position depending on the other's position that got hit with obstacles. When trying to do, transform.position = new Vector3( followobject.transform.position.x, transform.position.y, z); 

But it passes through the collider.

Please play that game to know more about it. And pls reply if you find the logic.

Maybe because you are using directly the transform position instead of the rigidbody2D, maybe that’s the reason it passes through the collider2d, I don’t know honestly