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: 40
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 11:27 AM
» Replies: 4
» Views: 184
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 06:34 AM
» Replies: 6
» Views: 344
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 1,062
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 263
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 351
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 1,006
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 325
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 192
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 4,970

 
  How to handle terrain holes?
Posted by: btduser - 04-09-2024, 04:55 PM - Forum: Obi Rope - Replies (7)

Hi, I'm wondering if there is a way to get obi rope to work with terrain holes. I can't find any mention of it except one other forum post that alluded to support being planned for 2022. If there is still no support, is there any kind of workaround besides disabling the entire obi collider on the terrain?

Print this item

  Selecting the particles inside of a sphere.
Posted by: SuikaSukiyo - 02-09-2024, 03:19 PM - Forum: Obi Softbody - Replies (3)

What is an easy way to select the particles in the center of a sphere when creating a particle group?

There is the method of removing layers by optimizing but is there a better way? 
Something like being able to specify a position to expand a selection from.

If I am missing some major tools for the particle group selector, I would greatly appreciate any directions.

Print this item

  Cloth Collision with Shuriken Particles
Posted by: vrtraining - 02-09-2024, 09:45 AM - Forum: Obi Cloth - Replies (1)

First i noticed a small mistake in example for Scripting Collisions in Online Documentation for Version 7. The class ObiCollisionEventArgs no longer exists, you might want to update it. I checked the signature of method and it ObiNativeContactList, so I fixed the example.

I want to ask that Im using Unity particle system and I want them to be destroyed by Obi Cloth or atleast they should not cross dynamic moving Obi Cloth. Particle System of Unity has its own collision and trigger module and it can destroy its own particles if it comes with in contact with a specific trigger or collider layer that we mention in its parameter. The problem is collision on Obi Cloth is very different, it does not use Unity Colliders or Layers. Is there anyway?

Like a complex option would I create a trigger collider and move it along with cloth particles but that would be unrealistic.

Print this item

  Softbodies intersecting easily
Posted by: MattS - 01-09-2024, 09:09 PM - Forum: Obi Softbody - Replies (6)

Hi Jose,

I'm finding that softbodies intersect and get stuck inside each other incredibly easily. In the video example, I have pretty much a standard ball from the ball pool scene and a larger hemisphere softbody. When I jump the ball onto the hemisphere, with very little forces involved other than gravity, the ball gets stuck in the larger object and sucked in.

I've tried enabling surface collisions but that makes it get stuck much quicker (and disables collisions with the static ground for some reason). I'm on Obi 6 still, I've not been able to get Obi 7 working yet.

Should softbody-softbody collisions be this unstable, or is there something I can do to improve them?

Video link: https://drive.google.com/file/d/1AHhu00a...sp=sharing

Thanks,

Matthew

Print this item

  Rope Moves across objects Issues
Posted by: Barax94 - 30-08-2024, 01:24 PM - Forum: Obi Rope - Replies (3)

Can you please help With below issues & desired behavior:

Video Link
https://youtu.be/TKmrRWXuSQE


Overview of what Im trying to acheieve

I have a rope with two control points: 

  • Start, is freezed on roation and postion
  • End, this attchment will be moved using XR-Grab and it is freezed on rotation-xyz and only moves on X & Y.
  • Currentlly both Attached Dynamic
What I need:
  • this rope to be smooth and NOT jittery as in the video-link andfor that i used settings in images below
  • This rope should collide with those cylender and not slide on them, here i tried to use [ High-Friction ]
  • Rope should either stretch or increase in length in smooth/good way, while im moving it using XR-Grab  (Giving that Start atttchments is freezed-xyz). Also the initial length of rope should be normal not too long as shown in the picture below, only when i move its End-Control-Point then it should sterch or increas legnth
Issues Im facing Overall:
  • OBI Particles Renderer not showing not showing particles, attached is settings used
  • As you can see in Video-Link,,, rope is bouncy, jittery & Rigid mainly when it touches those objects
  • When moving one end  of the rope. The ends becomes not perfectly alined with the attachments. Gab is seen
  • Rope is not colliding very well (OBI colliders and filter are set alreaddy). And it snaps

Note* Im not using code currently . Mainly im using the OBI rope. componenets configs 

I Know im asking alot but,  can you give/share me the best setting for (The solver, rope & attchments) to solve those issues or is if it's (allowed/possible) to have a Breief Technical Session to achieve that 



Attached Files Thumbnail(s)
                   
Print this item

Exclamación Obi Fluid 7 Transparent Fluid has no color
Posted by: steelroach - 30-08-2024, 12:01 PM - Forum: Obi Fluid - Replies (12)

I installed the latest Obi Fluid (7.0.1) on Unity 2022.3.27f1.


It seems like transparent fluids has all just water-like color and not changing at all. You can see an example below


   

Print this item

  Is there any way to fix cloth on specific point?
Posted by: gahyun11 - 30-08-2024, 07:37 AM - Forum: Obi Cloth - Replies (9)

Hello. I'm currently trying to attach clothes on specific point of body(actor's local space) using obi particle attachment(cloth)  pin constraint setting(body). I know I can make cloth stop falling from body using particle attachment with dynamic type and compliance value, but is there any way to attach cloth on specific position of actor's local space and edit the position in inspector or in editor with given value? Thank you

Print this item

Bug Obi 7.0 ParticleAPI
Posted by: PlatonSk - 29-08-2024, 11:37 AM - Forum: Obi Rope - Replies (12)

I’m trying to get the position of a particle at runtime using

Code:
for (int i = 0; i < actor.activeParticleCount; i++)
{
    var solverIndex = actor.solverIndices[i];
    var particlePos = actor.GetParticlePosition(solverIndex);
}

However, when the solver backend is set to GPU, it returns the position from the blueprint instead of the current position in the simulation. 

Is this a bug? 
If not, how can I retrieve the particle's position using the GPU (and is it even possible)?

Print this item

  Multi selected ObiCollider is changed only one
Posted by: asimofu_ok - 28-08-2024, 11:39 AM - Forum: General - Replies (4)

Sorry for repeating myself, but this time it is about Obi7's ObiCollider.

When I try to change Thickness or ObiCollisionMaterial while multiple objects with ObiCollider are selected, it seems that only one of the selected objects is changed.
My Unity version is 2022.3.42.

Print this item

  Issues After Upgrading to Obi Rope 7: Bounciness, Jitter, and Rope Generation Problem
Posted by: Destro26 - 27-08-2024, 07:50 PM - Forum: Obi Rope - Replies (4)

Hello,

I recently upgraded to Obi Rope 7 and encountered a few issues issues with the ropes not behaving as they did in Obi Rope 6. I've kept the same settings from Obi 6 and am using the default settings for the new solver options (except for substeps, which I set to match the value I used in the Obi Fixed Updater).

In my game, the player can shoot ropes. I originally based this mechanic on the Extendable Grappling Hook script provided with Obi Rope, although I've modified it over time. After upgrading to Obi 7, I found that I could no longer shoot ropes at all. I noticed the Extendable Grappling Hook script had changed since Obi 6, so I tried to apply similar changes to my custom rope generation script. This allowed rope generation to work again, but I'm not sure if I implemented it correctly, and I suspect this might be related to some of the issues I'm experiencing (particularly issues 2 & 3 below).

I've attached a video showing the differences between Obi 6 and Obi 7.



There are the issues I'm having:

  1. Increased Rope Bounciness:
    • When lifting certain rigidbodies, the ropes are much more bouncy than they were in Obi 6.
  2. Rope Flashing in the Wrong Location:
    • Occasionally, when generating a rope, it momentarily appears to connect from the player’s hand to the world origin for one frame.
  3. Unpredictable Behavior When Shooting Ropes at Rigidbodies:
    • When shooting ropes at rigidbodies (e.g., a box), the behavior is inconsistent. Sometimes the box is lifted into the air or pushed around unexpectedly. I think this might be related to the issue mentioned above.
  4. Increased Rope Jitter:
    • When ropes are left to settle, there seems to be more residual movement in Obi 7 compared to Obi 6. I'm using the same sleep threshold in both versions.
This is my Rope Generation script. (For now I've modified the Change length method in ObiCursor so that I can just pass in the new length rather than the length change)
Code:
public class RopeGenerator : MonoBehaviour{
        public float breakThreshhold = 0.1f;
        public float extraRopeLengthOnSpawn = 0;
        [SerializeField] private bool _useTearing;
        [SerializeField] private float _tearResistance = 800;

        [Range(0, 2)]
        [SerializeField] private float _stretchingScale = 1;
       
        public ObiSolver solver;
        public Material material;
        public ObiRopeSection section;

        [Range(0, 1)]
        public float hookResolution = 0.5f;

        //public float hookExtendRetractSpeed = 2;

        [FormerlySerializedAs("hookShootSpeed")]
        public float ropeShootSpeed = 1;

        public int particlePoolSize = 100;

        public float ropeParticleInverseMass = 100.0f;

        //public ObiRope rope;
        [SerializeField] private float ropeThickness = 0.5f;
        [SerializeField] private float cursorParticle = 4f;
        [SerializeField] private float sourceParticle = 2f;
        [SerializeField] private bool particleRendererOn = false;
        [SerializeField] private bool _useSurfaceCollision;
       
        public void InitialiseRope(RopeData ropeData, Action ropeInitialised = null) {
            if (ropeData.IsInitialised) {
                return;
            }
            // Setup a blueprint for the rope:
            ropeData.Blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
            ropeData.Blueprint.resolution = hookResolution;
            ropeData.Blueprint.pooledParticles = particlePoolSize;

            // Create both the rope and the solver:    
            ropeData.ObiRope = ropeData.RopeObject.AddComponent<ObiRope>();
            ropeData.RopeObject.AddComponent<ObiParticleRenderer>().enabled = particleRendererOn;

            ObiRopeExtrudedRenderer ropeRenderer = ropeData.RopeObject.AddComponent<ObiRopeExtrudedRenderer>();
            ropeRenderer.section = section;
            ropeRenderer.uvScale = new Vector2(1, 4);
            ropeRenderer.normalizeV = false;
            ropeRenderer.uvAnchor = 1;
            ropeRenderer.material = material;
            //ropeData.RopeObject.GetComponent<MeshRenderer>().material = material;

            // Tweak rope parameters:
            ropeData.ObiRope.maxBending = 0.02f;

            // Add a cursor to be able to change rope length:
            ropeData.Cursor = ropeData.RopeObject.AddComponent<ObiRopeCursor>();
            ropeData.Cursor.cursorMu = 0;
            ropeData.Cursor.direction = false;

            ropeData.ObiRope.tearingEnabled = _useTearing;
            if (_useTearing) {
                ropeData.ObiRope.tearResistanceMultiplier = _tearResistance;
            }

            ropeData.ObiRope.surfaceCollisions = _useSurfaceCollision;

            ropeData.ObiRope.stretchingScale = _stretchingScale;
            StartCoroutine(InitialiseRopeRoutine(ropeData, ropeInitialised));
        }

        IEnumerator InitialiseRopeRoutine(RopeData ropeData, Action ropeInitialised = null) {
            var localHit = Vector3.forward;

            // Procedurally generate the rope path (just a short segment, as we will extend it over time):
            int filterCollision = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);
            int filterNoCollision = ObiUtils.MakeFilter(ObiUtils.CollideWithNothing, 0);

            ropeData.Blueprint.path.Clear();
            ropeData.Blueprint.path.AddControlPoint(Vector3.zero, Vector3.zero, Vector3.zero, Vector3.up, 1 / ropeParticleInverseMass, 0.1f, ropeThickness, filterCollision, Color.white,
                "Rope start");
            ropeData.Blueprint.path.AddControlPoint(localHit.normalized * 0.5f, Vector3.zero, Vector3.zero, Vector3.up, 1 / ropeParticleInverseMass, 0.1f, ropeThickness, filterCollision,
                Color.white, "Rope end");

            ropeData.Blueprint.path.FlushEvents();

            // Generate the particle representation of the rope (wait until it has finished):
            yield return ropeData.Blueprint.Generate();
            ropeData.IsInitialised = true;
            yield return null;
            ropeInitialised?.Invoke();
        }

        private void LayParticlesInStraightLine(Vector3 origin, Vector3 direction, ObiRope rope)
        {
            // placing all particles in a straight line, respecting rope length
            float length = 0;
            for (int i = 0; i < rope.elements.Count; ++i)
            {
                int p1 = rope.elements[i].particle1;
                int p2 = rope.elements[i].particle2;
                solver.prevPositions[p1] = solver.positions[p1] = origin + direction * length;
                length += rope.elements[i].restLength;
                solver.prevPositions[p2] = solver.positions[p2] = origin + direction * length;
            }
        }
       
        public void GenerateRope(RopeData ropeData, RopeControlPoint sourceRcp, RopeControlPoint endRcp, Action<RopeData> onRopeGenerated, bool generateImmediately) {
            StartCoroutine(GenerateRopeRoutine());

            IEnumerator GenerateRopeRoutine() {
                var endRcpPosition = endRcp.transform.position;
                yield return null;
                // Clear pin constraints:
                var pinConstraints = ropeData.ObiRope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
                pinConstraints.Clear();

                if (generateImmediately) {
                    InitialiseRope(ropeData);
                }

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

                // wait for the solver to load the rope, after the next physics step:
                yield return new WaitForFixedUpdate();
                yield return null;
                // set masses to zero, as we're going to override positions while we extend the rope:
                if (!generateImmediately) {
                    for (int i = 0; i < ropeData.ObiRope.activeParticleCount; ++i)
                        solver.invMasses[ropeData.ObiRope.solverIndices[i]] = 0;
                }

                float currentLength = 0;
                const float maxPercentOfDistance = 0.75f; // the max percent of the distance between the source and the hit that the rope can extend to in one frame
               
                //move definitions out of loop
                Vector3 origin;
                Vector3 direction;
               
                // while the last particle hasn't reached the hit, extend the rope:
                do {
                    //--Set Cursor and source to a set number of particles away from the end of the rope
                    SetCursorAndSourceMu(ropeData, cursorParticle, sourceParticle);

                    // calculate rope origin in solver space:
                    origin = solver.transform.InverseTransformPoint(sourceRcp.transform.position); //spawn from rope origin
                    // update direction and distance to hook point:
                    direction = endRcpPosition - origin;
                    float distance = direction.magnitude;
                    direction.Normalize();
                   
                    LayParticlesInStraightLine(origin, direction, ropeData.ObiRope);
                   
                    if (generateImmediately) {
                        ropeData.Cursor.ChangeLength(distance + extraRopeLengthOnSpawn);
                    }
                    else {
                        // calculate the max increment for this frame to stop the increment from being larger than the distance.
                        float maxIncrement = distance * maxPercentOfDistance;
                        var increment = ropeShootSpeed;

                        increment = Mathf.Min(maxIncrement, increment);
                        // increase length:
                        currentLength += increment;
                        // if we have reached the desired length, break the loop:
                        if (currentLength >= distance) {
                            ropeData.Cursor.ChangeLength(distance + extraRopeLengthOnSpawn);
                            break;
                        }

                        // change rope length (clamp to distance between rope origin and hook to avoid overshoot)
                        ropeData.Cursor.ChangeLength(Mathf.Min(distance, currentLength));
                    }
                    yield return null;
                } while (!generateImmediately);

                // wait for the last length change to take effect, and ensure the rope is straight:
                yield return new WaitForFixedUpdate();
                yield return null;
                LayParticlesInStraightLine(origin, direction, ropeData.ObiRope);
               
                // restore masses so that the simulation takes over now that the rope is in place:
                for (int i = 0; i < ropeData.ObiRope.activeParticleCount; ++i)
                    solver.invMasses[ropeData.ObiRope.solverIndices[i]] = ropeParticleInverseMass; // 1/0.1 = 10

                // Pin both ends of the rope (this enables two-way interaction between character and rope):
                var batch = new ObiPinConstraintsBatch();
                batch.AddConstraint(ropeData.ObiRope.elements[0].particle1, sourceRcp.ObiCollider, Vector3.zero, Quaternion.identity, 0, 1000, breakThreshhold);
                batch.AddConstraint(ropeData.ObiRope.elements[^1].particle2, endRcp.ObiCollider, Vector3.zero, Quaternion.identity, 0, 1000, breakThreshhold);
                batch.activeConstraintCount = 2;
                pinConstraints.AddBatch(batch);

                ropeData.ObiRope.SetConstraintsDirty(Oni.ConstraintType.Pin);

                //--Set Cursor and source to a set number of particles away from the end of the rope
                SetCursorAndSourceMu(ropeData, cursorParticle, sourceParticle);

                //Add Rope Data to both Control points
                endRcp.RopeActivated(ropeData);     // must happen before onRopeGenerated Electrics needs to know the RCPs Rope Data
                endRcp.InitialisePointOnRopeGenerated(ropeData);     // must happen before onRopeGenerated Electrics needs to know the RCPs Rope Data
                onRopeGenerated?.Invoke(ropeData); // calls hand wait finished, source.RopeActivated, RopeManager.RopeGenerated and RcpAttachPoint.AttachRcp
            }
        }
        public void SetCursorAndSourceMu(RopeData ropeData, float cursorParticlesFromEnd, float sourceParticlesFromEnd) {
            cursorParticlesFromEnd = Mathf.Clamp(cursorParticlesFromEnd, 2.0f, (float)ropeData.ObiRope.activeParticleCount - 2);
            sourceParticlesFromEnd = Mathf.Clamp(sourceParticlesFromEnd, 2.0f, (float)ropeData.ObiRope.activeParticleCount - 2);
            ropeData.Cursor.cursorMu = 1 - cursorParticlesFromEnd / ropeData.ObiRope.activeParticleCount;
            ropeData.Cursor.sourceMu = 1 - sourceParticlesFromEnd / ropeData.ObiRope.activeParticleCount;
        }
    }


Any advice or suggestions on how to resolve these issues would be greatly appreciated!
Thanks in advance!

Print this item