Hello,

I have 2D fixed joints on my UI buttons as shown below:
147034-example1.png

I have extra code for the movement and stuff but in essence, each of these is in a 2d “train” using fixed joints. I don’t understand though, why isn’t Orange being moved down too since it’s attached to blue, it’s anchor is on blue? Shouldn’t it be attached and moving when blue moves? Instead I get the picture below…

147035-example2.png

So there are a few solutions for this. Basically whatever you are trying to do with physics is a terrible idea and won’t work.

You keep using the word train, but I have never heard of the word train to describe a foldable list. This is a tree view, not train.

What you want is that each node of your tree be able to calculate its height, kinda like this:

 float GetHeight() 
 {
     if (closed)
          return (self_height);
     else
     {
          float height = self_height;
          foreach (var child in children)
                height += child.GetHeight();
          return (height);
      }
}

Now you can calculate the position of any element.

But realistically, just use one of the dozen tree view package:

@maw0041 Build a UGUI Expandable Collapsable Windows With ContentSizeFitter & HorizontalLayoutGroup - No Code - YouTube
Bro just follow the link it has expandable menu tutorial.