Search Forums

(Advanced Search)

Latest Threads
Change rod section at run...
Forum: Obi Rope
Last Post: matty337s
10 hours ago
» Replies: 0
» Views: 16
Sliding along a rope
Forum: Obi Rope
Last Post: vrt0r
Yesterday, 07:43 PM
» Replies: 0
» Views: 17
In SolidifyOnContact exsa...
Forum: Obi Fluid
Last Post: asimofu_ok
Yesterday, 04:15 PM
» Replies: 2
» Views: 47
Is it possible to render ...
Forum: Obi Fluid
Last Post: asimofu_ok
Yesterday, 10:07 AM
» Replies: 2
» Views: 75
Cloth has stretchy behavi...
Forum: Obi Cloth
Last Post: Andreia Mendes
31-07-2025, 02:38 PM
» Replies: 22
» Views: 814
Get separate particles pa...
Forum: Obi Fluid
Last Post: slimedev
29-07-2025, 06:51 PM
» Replies: 6
» Views: 3,178
Solver outside of hierarc...
Forum: General
Last Post: Jawsarn
29-07-2025, 06:19 PM
» Replies: 4
» Views: 161
Rope ignoring colliders o...
Forum: Obi Rope
Last Post: josemendez
24-07-2025, 07:03 AM
» Replies: 1
» Views: 128
Ladder made by Ropes (Rat...
Forum: Obi Rope
Last Post: josemendez
23-07-2025, 01:43 PM
» Replies: 5
» Views: 306
can you remove particles ...
Forum: Obi Softbody
Last Post: josemendez
22-07-2025, 02:19 PM
» Replies: 1
» Views: 179

 
  Proper way of moving rope end points
Posted by: kripa1415 - 05-06-2024, 02:23 PM - Forum: Obi Rope - Replies (3)

Hi,
 I've added pins on both ends of the rope. I want to know whether I've used the right implementation to move the rope end points. I've created configurable joints on the rope end point node and dragging it using rigidbody MovePosition. I can't use force here as I want the end point knob to move along with my finger. Though I've applied max limit on the knob distance how far player can drag, it still break physics sometimes when I drag fast. Is there any possibility to avoid happening ?


Code:
Vector3 maxDist = otherEnd.transform.position + dir *  Mathf.Clamp(dist, 0, knobDistance);
maxDist.y = -8f;// yPos;
rb.MovePosition(maxDist);


Code:
Transform AttachJoint(Rigidbody rb, Vector3 attachmentPosition)
{
    GameObject go = new GameObject("Attachment Point");
    go.hideFlags = HideFlags.HideInHierarchy;
    go.transform.position = attachmentPosition;

    var newRb = go.AddComponent<Rigidbody>();
    newRb.isKinematic = true;

    var joint = go.AddComponent<ConfigurableJoint>();
    joint.connectedBody = rb;
    joint.configuredInWorldSpace = true;
    joint.xDrive = NewJointDrive(force, damping);
    joint.yDrive = NewJointDrive(force, damping);
    joint.zDrive = NewJointDrive(force, damping);
    joint.slerpDrive = NewJointDrive(force, damping);
    joint.rotationDriveMode = RotationDriveMode.Slerp;

    return go.transform;
}

private JointDrive NewJointDrive(float force, float damping)
{
    JointDrive drive = new JointDrive();
    drive.mode = JointDriveMode.Position;
    drive.positionSpring = force;
    drive.positionDamper = damping;
    drive.maximumForce = Mathf.Infinity;
    return drive;
}

Also, sometimes I see weird behavior after completing cursor.ChangeLength. You can see one or two rope particles at random location still alive in the scene.



Attached Files Thumbnail(s)
                   
Print this item

  Unpin Rope not working
Posted by: kripa1415 - 05-06-2024, 08:27 AM - Forum: Obi Rope - Replies (2)

Hi, 
I've attached pin at both end of the rope. I want to unpin it from one of the ends.
I've tried the below code but nothing seems to be working. Its always pinned even after running the below code.
I've attached reference screenshot of what I am trying to do. 
Created 2 ropes and pinned them on the board. I want to unpin one end of the rope and pull the rope to the other knob using obiropecursor. (ChangeLength function).
Using ObiRopeCursor is the right approach here ?

Code:
var pinConstraints = rope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
int batches = pinConstraints.batches.Count;
for (int j = 0; j < batches; j++)
{
    int count = pinConstraints.batches[j].constraintCount;
    Debug.Log("count : " + count);
    for (int i = 0; i < count; i++)
    {
        pinConstraints.batches[j].RemoveConstraint(i);
        pinConstraints.batches[j].RemoveFromSolver(null);
    }
    pinConstraints.RemoveBatch(pinConstraints.batches[j]);           
}
pinConstraints.RemoveFromSolver();

To test if cursor changeLength is working I manually disabled one of the pinned gameobject and tried the below code. ChangeLength function is also not working as expected.
Its pulling the rope only to some extent. After that rope got stiff and straightened. Attached screenshot.

Code:
private void Update()
  {
      if (knobDetached)
      {
          cursor.ChangeLength(rope.restLength - 30 * Time.deltaTime);
      }
  }

Note:
If I use ObiParticleAttachment instead of Pin Constraint, cursor changeLength is working as expected

Code:
private void RopeAttachment(ObiRope rope, ObiCollider bodyA, ObiCollider bodyB)
{
    attachment1 = rope.AddComponent<ObiParticleAttachment>();
    attachment1.target = bodyA.transform;
    attachment1.particleGroup = rope.blueprint.groups[0];
    attachment1.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;

    attachment2 = rope.AddComponent<ObiParticleAttachment>();
    attachment2.target = bodyB.transform;
    attachment2.particleGroup = rope.blueprint.groups[rope.blueprint.groups.Count - 1];
    attachment2.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
}



Attached Files Thumbnail(s)
       
Print this item

  Obi fluid use 2D light
Posted by: seenotevil92 - 05-06-2024, 12:38 AM - Forum: Obi Fluid - Replies (4)

Good afternoon.
I'm developing a 2D game.

I'm using 2D urp pipeline with obi fluid 7.

How can I get 2D light to work with obi (freedom etc)?


I tried adding a lit-sprite-shader but it didn't work.

Print this item

  Performance lag when more thn 4 ropes created
Posted by: kripa1415 - 03-06-2024, 06:48 AM - Forum: Obi Rope - Replies (6)

Is it possible to create a game similar to Twisted  Tangled Game published by Rollic Games.
I've tried and successfully created a few levels with just 2 to 3 ropes constructed twisted using a spline tool and created rope at runtime by generating blueprints.
But the problem is Obi started to slow down when I introduced the 4th rope. Even with just 4 ropes twisted and collided, It totally stopped working even in high end devices. In that rollic game, it's not slowing down even with 40 to 50 ropes. We don't see any performance lag with either 5 or 50 ropes. How's that done ?
I tried the Ultimate rope tool, which lacks collision strength and a few other limitations too. Failed!
Then I tried creating my own rope using Dreamtek tuberenderer. Not even close to the Ultimate rope tool. Failed!.
Then tried Rope MiniKit, that's the worst of them all. No support for rope-rope collision.

So I wonder what's the possibility of at least coming close to that game ?

Print this item

  ObiRodCursor
Posted by: CaDev - 29-05-2024, 01:41 PM - Forum: Obi Rope - Replies (7)

I need cursor functionality for obirod like its provided for obirope to change lenghts and set minimum length, how to create to get one?

Print this item

  Allocating particles at the start of the game to prevent lags on creation
Posted by: bozdo - 28-05-2024, 02:00 PM - Forum: Obi Softbody - Replies (1)

In my game player is creating softbodies in runtime. Now, when it happens game lags a little. I assume its happens because at the moment of softbody creation obi solver does not have needed amount of particles and it creates new ones. Can I somehow tell obi solver to create some amount of particles at the start of the game? Im already using object pool for softbodies but even though Im instantiating some amount of softbodies at the start and releasing them but solver does not create particles for them probably because Im creating and releasing softbodies too fast. My current solution is to instantiate softbodies at the start and after 1-2 frames release those softbodies. This way solver is creating needed particles and game does not lag on creation of new softbodies

Print this item

  Rope going inside table
Posted by: balaji.v - 27-05-2024, 05:41 PM - Forum: Obi Rope - Replies (1)

Hi,
I have added obi collider to the table and rope. But when we pull the rope, its going inside the table. How to avoid the rope going inside the table or any other obi collider?

Print this item

  [Solved] Creating a ribbon
Posted by: Elias - 23-05-2024, 01:22 PM - Forum: Obi Rope - Replies (4)

Hi,
for a project I'm trying to create something akin to a ribbon, or an open conveyor belt.
It will only need to be simulated in two directions (X/Y) and it shouldn't rotate around the X-axis.
Getting it to simulate in two directions was easy, thanks to the 2D Solver setting, however the rope keeps randomly rotating around the X-axis. 'standing up'.
In another thread I read that rope particles don't have an up-vector, however they do seem to have some kind of rotational value stored, as they don't always seem to be pointing in the same direction.
Is it possible to restrict them from rotating around a specific axis? Or is there a way to disable the billboarding effect on the line renderer, to have it always face the same direction regardless of the camera?

Print this item

  (Obi7) Particle renderer not working
Posted by: NekoKOKO - 22-05-2024, 06:51 PM - Forum: Obi Cloth - Replies (3)

Hi team,

I'm trying to use the Obi Particle Renderer to visualize the particles using Obi7 in the Benchmark Scene, but nothing shows up there in the scene. I switched back to Obi6 and it's working as expected, so I believe this is a bug of the new plugin.

Print this item

  How to solidify particles
Posted by: Jaakk0S - 22-05-2024, 08:55 AM - Forum: Obi Rope - Replies (4)

Hi!

[Image: rope-issue.png]

The picture should show what I am tryng to achieve. My rope consists of two parts:
1. A static rod that is attached to the character's left hand
2. A dynamic rope that starts from the character's left hand

The rope is dynamically generated using two control points with tangent vectors, so the rope path points out from the character's hand to the correct direction. The rope attaches to the hand using a static attachment. This part works flawlessly.

However, after physics the rope is hanging towards the ground from its attachment. I would like it to be stiff in the first few particles, then loosen up, gradually, if possible. The first particles in the attachment should respect the original path direction.

How would you suggest I achieve this? Maybe adding some constraints to the first particles. I don't know how to do this, it gets complicated.

Here's the blueprint generating code.

Code:
this.Blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
this.Blueprint.resolution = 0.7f;
this.Blueprint.pooledParticles = 200;
this.Blueprint.thickness = 0.04f;
this.Blueprint.path.Clear();
this.Blueprint.path.AddControlPoint(ropeHolderLocalPosition, -ropeHolderLocalPosition, ropeHolderLocalPosition, Vector3.up, 0.1f, 0.1f, 1, collidesWithEverythingFilter, Color.white, "left-hand");
this.Blueprint.path.AddControlPoint(this.ParticleRope.transform.InverseTransformPoint(this.RopeAttachment.transform.position), -hookLocalPosition, hookLocalPosition, Vector3.up, 0.1f, 0.1f, 1, collidesWithEverythingFilter, Color.white, "hook");
this.Blueprint.path.FlushEvents();
yield return this.Blueprint.Generate();

Print this item