Search Forums

(Advanced Search)

Latest Threads
Stretching verts uniforml...
Forum: Obi Softbody
Last Post: Aroosh
Today, 05:32 AM
» Replies: 0
» Views: 61
Scripting rod forces
Forum: Obi Rope
Last Post: chenji
11-09-2025, 01:15 PM
» Replies: 25
» Views: 2,558
Burst error causing crash...
Forum: Obi Rope
Last Post: josemendez
10-09-2025, 07:03 AM
» Replies: 1
» Views: 167
Controlling speed of emit...
Forum: Obi Fluid
Last Post: josemendez
06-09-2025, 06:29 AM
» Replies: 1
» Views: 420
Looks nice on editor but ...
Forum: Obi Fluid
Last Post: josemendez
04-09-2025, 07:20 AM
» Replies: 3
» Views: 671
How to Shorten or Scale t...
Forum: Obi Rope
Last Post: josemendez
02-09-2025, 09:53 AM
» Replies: 5
» Views: 762
The Limitation of Using O...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 10:30 PM
» Replies: 1
» Views: 506
Bug Where a Straight Segm...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 08:46 PM
» Replies: 1
» Views: 480
Having an issue with obi ...
Forum: Obi Rope
Last Post: Ben_bionic
29-08-2025, 04:23 PM
» Replies: 4
» Views: 974
Non-uniform particle dist...
Forum: Obi Rope
Last Post: chenji
29-08-2025, 09:05 AM
» Replies: 4
» Views: 825

 
  Ropes have no collision
Posted by: Schmaniel - 08-09-2021, 10:18 PM - Forum: Obi Rope - Replies (2)

Good day,
I am having troubles spawning ropes from the code.
I wrote my code very similar to GrapplingHook.cs (a sample scene).
I now have the problem that the so-spawned ropes have no collision. Here is the code from that.
Any ideas where the problem could be?

Code:
   public void SpawnWire(Vector3 end1, Vector3 localHit)
    {
        // Create the rope
        GameObject emptyGameObjectForOneRope = new GameObject();
        emptyGameObjectForOneRope.transform.parent = this.transform;
        rope = emptyGameObjectForOneRope.AddComponent<ObiRope>();
        ropeRenderer = emptyGameObjectForOneRope.AddComponent<ObiRopeExtrudedRenderer>();
        //ropeRenderer.section = section;
        ropeRenderer.uvScale = new Vector2(1, 5);
        ropeRenderer.normalizeV = true;
        ropeRenderer.uvAnchor = 0;
        ropeRenderer.thicknessScale = 0.5f;
        rope.GetComponent<MeshRenderer>().material = material;

        // Setup a blueprint for the rope:

        blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
        blueprint.resolution = 0.5f;
        blueprint.thickness = 0.5f;
        blueprint.pooledParticles = 100;

        // Tweak rope parameters:
        rope.selfCollisions = true;
        rope.surfaceCollisions = true;
        rope.collisionMaterial = obiCollisionMaterial;

        // Add a cursor to be able to change rope length:
        cursor = emptyGameObjectForOneRope.AddComponent<ObiRopeCursor>();
        cursor.cursorMu = 0;
        cursor.direction = true;

        ////////////////////////////////////////////////////
        this.end1 = end1;
        this.localHit = localHit;
        StartCoroutine("CoRoutineXD");
        // Procedurally generate the rope path (a simple straight line):

    }
    public IEnumerator CoRoutineXD()
    {
        yield return 0;

        // Procedurally generate the rope path (not quite a simple straight line, I could change it back though):
        blueprint.path.Clear();
        blueprint.path.AddControlPoint(end1, Vector3.back, Vector3.forward, Vector3.up, 0.1f, 0.1f, 1, 1, Color.white, "Hook start");
        blueprint.path.AddControlPoint(localHit, Vector3.forward, Vector3.back, Vector3.up, 0.1f, 0.1f, 1, 1, Color.white, "Hook end");
        blueprint.path.FlushEvents();

        // Generate the particle representation of the rope (wait until it has finished):
        yield return blueprint.Generate();

        // Set the blueprint (this adds particles/constraints to the solver and starts simulating them).
        rope.ropeBlueprint = blueprint;
        rope.GetComponent<MeshRenderer>().enabled = true;

        //   



        // Pin both ends of the rope (this enables two-way interaction between character and rope):
        var pinConstraints = rope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
        pinConstraints.Clear();
        var batch = new ObiPinConstraintsBatch();
        batch.AddConstraint(rope.solverIndices[0], gameObject.GetComponent<ObiCollider>(), localHit, Quaternion.identity, 0, 0, float.PositiveInfinity);
        batch.AddConstraint(rope.solverIndices[blueprint.activeParticleCount - 1], gameObject.GetComponent<ObiCollider>(),
                                                          end1, Quaternion.identity, 0, 0, float.PositiveInfinity);
        batch.activeConstraintCount = 2;
        pinConstraints.AddBatch(batch);

        rope.SetConstraintsDirty(Oni.ConstraintType.Pin);
        cursor.ChangeLength(wireLength);

Print this item

Pregunta Climbing on rope and fix to move only on x, y
Posted by: lacasrac - 08-09-2021, 05:56 AM - Forum: Obi Rope - Replies (13)

Hello there,

I created this rope climbing with Unity joints:

https://youtu.be/mePXonwqEN0

Also this is a 2d game in a 3d world so I just tilted the z axis movement on the rope..

Can I do this two things with ObiRope better/cheaper than joints? Can I create a climbing system?

Thanks

Print this item

  Raycast. Interaction with liquid
Posted by: Igor_Kozulin - 07-09-2021, 04:30 PM - Forum: Obi Fluid - Replies (1)

Help me, please.
Is there a way to register the interaction of rays with a liquid?
The task is as follows:
if a ray hits a liquid, then it turns red, otherwise, it remains blue.

Print this item

Estrella How to Grow Length of rope from tail at runtime?
Posted by: uv_unity - 07-09-2021, 09:38 AM - Forum: Obi Rope - Replies (1)

Hi, how to grow 'x' amount of length of from from tail end of the rope at runtime? Eg. if length is 1, increase/add .2f more length from tail.  New to Obi... please help! Tímido Huh

Print this item

  Synty Banner?
Posted by: MaximilianPs - 04-09-2021, 05:04 PM - Forum: Obi Cloth - Replies (7)

Hello there, 
 just purchased OBI Cloth...
I'm on Unity 2019.4

 I'm trying to make Synty's banners as cloth, but them are 3D models, and them won't react at all  Indeciso
The parent object is the Solver.

[Image: ef6ONxX.png]

[Image: LznpMhe.png]

I've also edited the Mesh, to make it flat, but still won't react... what I miss? Triste

Print this item

  ObiRope Odd Pin Problem VR
Posted by: Faffy_Waffles - 31-08-2021, 06:38 AM - Forum: Obi Rope - Replies (2)

I'm not really sure how to even describe it. I've created a video that shows the problem better than words can, I think. https://youtu.be/boLF2lflf30

Print this item

  What is Constraint Orientation for?
Posted by: arowanaito - 28-08-2021, 05:54 AM - Forum: General - Replies (2)

What is the use for Constraint Orientation checkbox in Obi Particle Attachment component?

Print this item

  Coloring half of a rope
Posted by: Nyxtra - 26-08-2021, 09:29 AM - Forum: Obi Rope - Replies (2)

Hi!
I'm using ObiRopeLineRenderer to render my rope. In certain places on the rope its halves need to be different colors, I am attaching a picture with an example.
To do this i assign colors in the solver array, and in alpha channel I specify which half should be colored. When mesh is updated in renderer I then assign vertex colors according to alpha.
This works mostly fine, except for cases when half that needs to be colored changes, like in the picture. When two neighboring vertices have the same color, there is a line across that is brigther than sides by themselves.
Is there any way I could avoid this? Maybe make this line less bright?
Appreciate any advice!



Attached Files
.png   Untitled1.png (Size: 44.09 KB / Downloads: 17)
Print this item

  How to destroy softbody
Posted by: minko - 26-08-2021, 02:29 AM - Forum: Obi Softbody - Replies (2)

When I destroy a softbody, penetrating bug occasionally appears, 11 seconds in the video softbody demo

Print this item

  What is the best solution for big ratio between rope and attached objects
Posted by: Tattler - 23-08-2021, 09:23 AM - Forum: Obi Rope - Replies (1)

I have a scene with small boat(tug boat) which must pull a bigger ship. I try to attach both boats with obi rope. Small boat is 400 tons and the big ship is 32 000 tons. I try to create 50m rope, with less elasticity as possible. To achieve this I set particle mass to be 150kg and have around 1000 particles, which makes rope mass of 150 tons. I set distance constraint iteration to 30, set substep to 8.

With this setup when I add required force to the small boat, the rope stretches to around 60m and start pulling the big ship which is final result I want. 

My questions is:

- Can I do something more to make rope less elastic with this kind of attached objects mass with way bigger ratio than 10:1.
- Can I find what force applies rope to the attached objects. Because of unrealistic heavy rope(150 tons), when I connect rope to the small boat, the rope itself start pulling small boat in his direction. If I can find what is the force of the rope, maybe can put opposite force to the small boat to balance this force and prevent small boat from moving.

Any help will be appreciated!

Print this item