A Moving Line That Connects 2 Objects
CreatiCode last edited by
You can add a solid line that connects 2 objects, and when these 2 objects move, the line will move with them. To do that, you use the following block:
- Object 1 and Object 2: The first 2 inputs should be the names of the 2 objects you are trying to connect. If one or both of these objects are not found, then no line will be added.
- Color: The color of the line.
- Diameter: The thickness of the line.
- Sides: The number of sides of the line. If you would like the line to look like a tube, then you can use 16 or 32 sides.
- Name: The name of this line. This can be used to remove this line later.
After the moving line is added, whenever one or both objects move, the line will automatically move to stay between the 2 objects.
For example, in this program below, we add 2 boxes named “a” and “b”, then add a moving line that connects them. After that, if we move the 2 objects, the line is always between these 2 objects.