Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

The Challenge: Making Two Balls Move In A Fixed, Unchanging Formation

Discussion in 'Physics' started by Crash370, Nov 13, 2017.

  1. Crash370

    Crash370

    Joined:
    Nov 6, 2017
    Posts:
    3
    Hello guys, first time here, hopefully one of you far more qualified people can help me out.

    I'm working on something of an upgrade to the Rollerball tutorial - a (sort of) combo of table football and air hockey, but that's not important. What's important is that I want to hold two balls in a fixed formation,like in this link.

    I've got the balls moving simultaneously, so no need to worry about that. The problem comes with collisions with other objects. If one ball hits a wall for example, the other ball doesn't stop moving, and so the formation is broken, like in this link.

    Ideally, I want the two balls to move in sync and stop in sync, maintaining the starting formation without any change in distance or position. I've considered the idea of transparently fixing them together (I don't know if that would work?) but I thought I'd post the question here, since googling hasn't turned up any answers. Any suggestions would be appreciated.

    Thank you for any help in advance!
     
  2. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    a) use a physics joint (fixed)
    b) make parent object that contains two sphere colliders and two balls as children that have no collider (only visuals)
     
  3. Crash370

    Crash370

    Joined:
    Nov 6, 2017
    Posts:
    3
    Thank you for the help, that works excellently!