foreword
How to use the Obi.Rope plugin
creation of the rope
The created Obi Rope, Inspector panel is as follows, there are many components, among which Obi Solver is the general processor of rope, cloth, liquid, etc., and this component can also be separated out as an independent game object.
rope shape
Obi's own rope editor, ObiCurve, can adjust the shape, length, bending, etc. of the rope. Click the Edit curve button. Then the auxiliary points of the Curve editor as shown below will appear in the Editor panel, and the key points of the rope can be added, deleted, translated, and rotated.
The material of the rope
Find the material that comes with the plug-in, drag it to the rope, and the rope will appear as shown below. Click the Initialize button of Obi Rope to initialize the rope, and the rope changes from the white line just now to the shape of a rope.
The display
UV Scale of the rope can be adjusted as follows: Set the UV Selction Thickness Scale of the texture
: Set the thickness of the rope
rope fixation
One end of the rope generally needs to be fixed to an object or wall.
We click on Obi Rope's Edit particels button. The rope in the Editor panel will turn into a bunch of blue dots as shown below. These blue points are the information points of the rope, which control the fixing, handle, and binding of the rope to the object. There is also information on the smoothness of the rope.
We select the top blue information point, and the particle editor panel will appear in the lower right corner, and we can see many buttons, among which the four red buttons in the third row are for fixing and controlling the set point.
The first one is fixed coordinates, it seems to be enabled, gray when consistent, the
second is fixed coordinates and rotation,
the third is unfixed
, the fourth is to create a handle point, our program can control the handle point to make the rope move
rope control
Binding of ropes and colliders
First create a Cube collider, then add the Obi Collider component, and then the Cube can interact with the rope for collision.
You can also add a Rigidobject rigid body to the Cube, so that the Cube has gravity.
Then we click the blue information point at the bottom of the rope, find the Obi Pin Constraints component in the Inspector panel of the rope, click the Add Pin Constraint button, and then drag the Cube to the Pinned To parameter to realize the binding of the rope and the Cube .
Run, the scene is as follows;
the top of the rope is fixed, and the bottom is bound to the Cube. We move the Cube and find that the rope is shaking.
The parameters of the rope
Stretch: Distance in Obj Solver
The smaller the Iterations, the more slack the rope. The bigger the tighter the rope
Rope Physical Material
You can set the elasticity of the rope, the friction coefficient, etc.
We can create the Obi physical material by ourselves, or use the material that comes with the Obi example.