{{description>Create connections between Control Points in Curvy Splines, synchronize their position and rotation, and make seamless curves with the Follow-Up feature.}} {{indexmenu_n>4}} ====== Connections ====== A connection is a relationship between two or more Control Points. That relationship can be used for a variety of effects: having junctions for your railway game, synchronizing the position and/or rotation of Control Points, defining teleport points between two curves etc...

===== How to create a Connection===== Select the Control Points you want to connect, and then click on the [[..:toolbar:start#connect|Connect]] button in the [[..:toolbar:start]]. A Control Point can be part of only one connection, but a connection can have multiple Control Points. ===== How it works ===== Technically, connections are individual GameObjects with the CurvyConnection component attached. They are stored as children of the [[..:components:curvyglobal]] GameObject and automatically managed using the Toolbar or corresponding API methods. If a Control Point is part of a connection, the connection's inspector is shown inside the Control Point inspector for convenience You can use a connection in different way: The most common one is to synchronize the position and/or orientation of connected Control Points. To do so, setup the parameters in the connection's inspector accordingly. More about that in the Reference section bellow. You can also make a Controller use connections by defining its [[..:controllers:start#connections_handling|Connections Handling]]. You can use the CurvyConnection class via the [[https://api.curvyeditor.com|API]] to code your own connections related logic. ===== Follow-Up ===== As you know, some spline types (e.g. Catmull-Rom and TCB) use more than the two directly adjacent Control Points to define the curve. If you connect the end of a spline to another spline, you might want to make the curve look "seamless" (like the other spline's CPs would be part of the first spline). To achieve this you can define at which connected Control Point the curve should "go on" calculation-wise. This is called a "Follow-Up". Think of it as the natural extension of the ending spline. For example: Take two Catmull-Rom splines and connect the last CP of the first spline with the first CP of the second spline and set both CPs to full sync. If you move the connection around you'll notice that the joined curve breaks. For each CP, define the other CP as the Follow-Up and you'll see the joined curve looks like a single curve, without a break. That's because the other spline's Control Points now becomes part of segment calculation. ===== Reference ===== ====Control Point Options==== Lists all Control Points belonging to a connection ==Control Point== Shows the name of the Control Point. You can select the Control Point or remove it from the connection through the available buttons. == Sync Position == Defines whether the connection's position is applied to this Control Point == Sync Rotation == Defines whether the connection's rotation is applied to this Control Point == Synchronization Presets == Use the preset buttons to quickly set synchronization options on all the Control Points ====Follow-Up==== List the connection's Control Points that are one of the ends of an open spline == Spline == The open spline which Follow-Up is being defining == Control Point == The end of the spline which is concerned by the Follow-Up == Follow-Up == The connected Control Point acting as a [[#Follow-Up]] == Heading Direction == //Available only when a Follow-Up is defined// In which direction the Follow-Up should continue on. Available options are: * **To spline's start** - The Follow-Up segment continues towards its spline's start * **Nowhere** - head to spline's start * **To spline's end** - The Follow-Up segment continues towards its spline's end * **Automatic** - Automatically selects the best option, based on the position of the Follow-Up within its spline ====Connection Options==== == Delete connection== Deletes the connnection GameObject