Search Forums

(Advanced Search)

Latest Threads
can you remove particles ...
Forum: Obi Softbody
Last Post: aardworm
09-07-2025, 07:09 AM
» Replies: 0
» Views: 105
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 11:27 AM
» Replies: 4
» Views: 383
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 06:34 AM
» Replies: 6
» Views: 533
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 1,258
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 353
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 431
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 1,209
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 419
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 246
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 5,519

 
  Null reference exception on start (do not disable scene reload *solved)
Posted by: fleity - 10-09-2021, 01:21 PM - Forum: Obi Rope - Replies (2)

hi everyone I have a very weird problem that I have trouble figuring out. 

I have imported obi rope 6.2 into a 2021.1.19f1 vr hdrp project I am working on and when I try to start a scene with a rope or rod all I get is a null ref exception in ObiConstraints.cs 

actor.solverBatchOffsets[constraintType].Clear();

explicitly solverBatchOffsets is what is null. 
Backend used doesn't matter 

My testscene is empty except for camera, directional light and obi rope and obi solver. The blueprint is also unaltered straight from create asset.

In a completely new project (same unity version, hdrp, steam vr too) the issue does not appear. 


Why could this go wrong? Is there a way I can hotfix this?

---
I suspect that either Awake isn't called correctly on ObiActor or that solverBatchOffsets is not serialized. In any case when I check if solverbatchOffsets is null in ObiActor.OnEnable it does return null as well. Initializing it in OnEnable prevents the error but breaks the simulation.

--- figured it out ---
Awake isn't called (and I guess on many other important components too) when you have Scene reload disabled Rodar ojos Astuto (I am stupid, hopefulyl this spares someone else the hours to find out)

Print this item

  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