To create a rope, access the GameObject menu. Select Create Other -> Ultimate Game Tools -> Rope. A new GameObject with the Ultimate Rope component will be added to the scene
First of all, change the Rope Type parameter depending on the rope you want to create:
If you are creating a Procedural rope or a LinkedObjects rope, set the "Rope Start" parameter to the gameobject that will be the starting point of the rope, and the "Segment End" parameter (Rope Segment section) to the gameobject that will be the end point of the rope. If you want to create multiple segments then the last one will be the end one.
Now you can go into playmode to see the rope physics in action. Very important! Make sure that the "Length" parameter is larger than the actual separation between the gameobjects, otherwise you will see the rope go haywire.
If you are creating an ImportBones type rope then you can mail us () to provide you an example Unity project that makes use of this type of rope.
The Procedural rope will generate both the mesh and physics for you:
Sets the rope layer. Use it to filter graphics and also for collision filtering.
Sets the rope physic material. This will affect the friction and bounciness.
Switches to another rope type.
Controls the rope start point.
Controls the rope diameter in units.
Larger values will create a rounder rope section.
Use it to change the rope's visual appearance.
Changes the material of the start and end caps and the cross sections of breakable ropes.
Enables to elongate the rope through scripting. The rope will grow/shrink from the end.
How much can the rope be elongated. Large values will need more processing power.
For extensible ropes, it adds a coil so you can see where the rope winds/unwinds.
The "cylinder" that will act as the coil.
Coil object's axis along which the coil is going to rotate. If you look from the coil in direction to Rope Start, it needs to be the Coil Object's axis that is looking to the right.
Coil object's axis that is pointing upwards.
Indicates the coil width. This limits the width along which the rope can be placed on the coil.
Controls the coil diameter. The rope will start winding with this diameter.
Larger values will create smoother coils but will need more processing power.
One or more segments that the rope will consist of. The last one is always the end of the rope.
The end of this rope segment. The last one will mark where the rope ends.
The length of this segment.
The number of links to generate to simulate the rope segment. Larger values will create smoother ropes but will need more processing power.
The type of collider to generate for each link. Use only if you need collisions, but it will also affect the physic behaviour.
Creates colliders only each n links. If you have many links you may increase this value to improve performance.
Establishes the mass value of each link
Larger values will increase physics precision but will also need more processing power.
How much each link can rotate up/down along the rope segment.
How much each link can rotate left/right along the rope segment.
How much each link can twist along the rope segment.
Strength of a rubber-band pull towards the original position.
Resistance against the spring.
Strength applied towards the original position.
Set to a different value than Infinity to make the rope breakable when a force greater than this value is applied to a link.
Set to a different value than Infinity to make the rope breakable when a torque greater than this value is applied to a link.
Sends events when a rope was broken (Break Force or Break Torque have to be different than Infinity).
The object that the events will be sent to.
The name of the method from the Events Object Receiver that will be invoked using SendMessage(). Check the scripting help for more information.
This will save all parameters and rope state after exiting the play mode.
Regenerates the rope in its original position. Note if one ore more control points of the rope are dynamic, all of them will return to their original position. If you want to move one or some of them and then recompute the rope with the new placement, mark them all as kinematic first and then reset the rope.
Deletes the rope.
The LinkedObjects rope will generate a chain using a given object as link
Sets the rope layer. Use it to filter graphics and also for collision filtering.
Sets the rope physic material. This will affect the friction and bounciness.
Switches to another rope type.
Controls the rope start point.
Sets the object that will be used as link in the rope chain.
Change it to orient the link properly.
Changes the distance between links. Set it to negative values to overlap and to positive values to keep distance.
Changes the twist angle of the links along its axis.
Sets an incremental twist from one link to the next.
One or more segments that the rope will consist of. The last one is always the end of the rope.
The end of this rope segment. The last one will mark where the rope ends.
The length of this segment.
The number of links to generate to simulate the rope segment. Larger values will create smoother ropes but will need more processing power.
The type of collider to generate for each link. Use only if you need collisions, but it will also affect the physic behaviour.
Creates colliders only each n links. If you have many links you may increase this value to improve performance.
Establishes the mass value of each link
Larger values will increase physics precision but will also need more processing power.
How much each link can rotate up/down along the rope segment.
How much each link can rotate left/right along the rope segment.
How much each link can twist along the rope segment.
Strength of a rubber-band pull towards the original position.
Resistance against the spring.
Strength applied towards the original position.
Set to a different value than Infinity to make the rope breakable when a force greater than this value is applied to a link.
Set to a different value than Infinity to make the rope breakable when a torque greater than this value is applied to a link.
Sends events when a rope was broken (Break Force or Break Torque have to be different than Infinity).
The object that the events will be sent to.
The name of the method from the Events Object Receiver that will be invoked using SendMessage(). Check the scripting help for more information.
This will save all parameters and rope state after exiting the play mode.
Regenerates the rope in its original position. Note if one ore more control points of the rope are dynamic, all of them will return to their original position.
If you want to move one or some of them and then recompute the rope with the new placement, mark them all as kinematic first and then reset the rope.
Deletes the rope.
The ImportedBones rope will apply rope physics to an already existing set of bones. This means you can create and skin meshes externally and use the rope editor to apply physics on top.
For example:
The name doesn't matter, but the suffix number does. It can be increasing/decreasing and the number of characters may not be constant (1 and 11 vs 01 and 11) so it is very flexible.
In any case, if there is a naming problem the editor will output self-explanatory error messages.
Sets the rope layer. Use it to filter graphics and also for collision filtering.
Sets the rope physic material. This will affect the friction and bounciness.
Switches to another rope type.
Changes the bone that will start the rope
Changes the bone that will end the rope
Comma-separated indices of the bones that will stay still and not have rope physics. Ranges are also valid like this example: 0, 1, 3-6, 10
If a bone name is Object_113 for example, it will be referred as 113.
Will skip collider creation for all bones in this list. The syntax is the same as the Static Bone List.
The bone axis along which each bones are placed.
The collider type that will be generated.
The diameter of the rope collider.
Creates colliders only each n bones. If you have many bones you may increase this value to improve performance.
Adjusts the length of the colliders.
Adjusts the offset of the colliders.
Establishes the mass value of each link
Larger values will increase physics precision but will also need more processing power.
How much each link can rotate up/down along the rope segment.
How much each link can rotate left/right along the rope segment.
How much each link can twist along the rope segment.
Strength of a rubber-band pull towards the original position.
Resistance against the spring.
Strength applied towards the original position.
Set to a different value than Infinity to make the rope breakable when a force greater than this value is applied to a link.
Set to a different value than Infinity to make the rope breakable when a torque greater than this value is applied to a link.
Sends events when a rope was broken (Break Force or Break Torque have to be different than Infinity).
The object that the events will be sent to.
The name of the method from the Events Object Receiver that will be invoked using SendMessage(). Check the scripting help for more information.
This will save all parameters and rope state after exiting the play mode.
Regenerates the rope in its original position. Note if one ore more control points of the rope are dynamic, all of them will return to their original position.
If you want to move one or some of them and then recompute the rope with the new placement, mark them all as kinematic first and then reset the rope.
Deletes the rope.
The following methods of UltimateRope have been created to allow scripting interaction:
Extends the rope. The rope needs to have its Is Extensible parameter checked in order to work.
if eRopeExtensionMode is set to UltimateRope.LinearExtensionIncrement, fIncrement will be given in units (positive to elongate, negative to reduce).
if eRopeExtensionMode is set to UltimateRope..CoilRotationIncrement, fIncrement will be given in degrees (positive to elongate and negative to reduce). To use the CoilRotationIncrement mode, the rope besides having the Is Extension checked will also need to have the Has A Coil value set.
To check at any given moment the amount of extended coil, you may check the UltimateRope.m_fCurrentExtension variable. This value will be always between 0 and UltimateRope.ExtensibleLength.
Values that put the rope extension outside the valid range will be clamped.
Must be called on the ImportedBones type rope right before you are going to move an object that has a skin affected by it. Otherwise the bones may not move along with it.
This is only needed when you are respawning it to another place. After respawning the object call AfterImportedBonesObjectRespawn().
Must be called right after you respawned an object that has a rope of type ImportedBones attached. This de-parents the free bones again.
When a rope breaks and the Send Rope Events parameter has been checked, a message will be sent to the receiver object. A method like this needs to be created:
void OnRopeBreak(UltimateRope.RopeBreakEventInfo breakInfo) {
// Do stuff here
}
The RopeBreakEventInfo has the following members:
The rope that was broken
The link that was broken on one side (this is the one always closer to the rope start).
The link that was broken on the other side (this is the one always closer to the rope end).
The break position in world coordinates.
The break position in link1's local coordinates.
The break position in link2's local coordinates.