Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    A Moving Line That Connects 2 Objects

    3D Blocks
    1
    1
    203
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

      Description

      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:

      6aa415f1-ae67-42a7-b36d-e5cb2acc00ea-image.png

       
      Parameters:

      • 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.

      Demo

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post