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

 
  Dragging the edge of a rope
Posted by: Sanppy - 22-12-2021, 12:00 PM - Forum: Obi Rope - Replies (4)

Hey there,

I'd like to be able to have the edge of a rope move as the user drags the mouse cursor.

I tried doing this with a blueprint but I had two issues:

1. The blueprint got permanently changed.
2. The effect wasn't visible in the game in real-time, instead it was just visible in the editor, and the next time I ran the game.

Am I missing something? Is there a better way?

Here's the relevant code segment: 

Code:
ObiWingedPoint point = rope.ropeBlueprint.path.points[0];
point.position = worldMousePosition;
rope.ropeBlueprint.path.points[0] = point;

Many thanks.

Print this item

  Collider Problem
Posted by: saltuksy - 22-12-2021, 11:27 AM - Forum: Obi Softbody - Replies (3)

The collider is large for the object.How can I fix?



Attached Files Thumbnail(s)
   
Print this item

  Moving object along the rope
Posted by: sodach1 - 20-12-2021, 08:57 PM - Forum: Obi Rope - Replies (3)

Hi guys. Can anyone give me an advice on which features to use to attach an object to a rope and move it along, like along a dynamic spline?
    I wanted to use Particle Attachment and move the path point assigned in there, but as far as I understood, you can't move path points like this. So the thing is what should I do?

Print this item

  Getting Obi Rope GameObject from ObiSolver.Raycast
Posted by: Sanppy - 20-12-2021, 05:09 PM - Forum: Obi Rope - Replies (1)

Hey everyone,

I'm building a game in which Obi Ropes are supposed to be interactive objects that respond to mouse clicks.

I'm using the ObiSolver.Raycast example to determine whether a mouse click hit the rope and I'm able to get a QueryResult that seems to be correct for the relevant rope.
What I'm lacking is the next step in the process, and that is to get the GameObject associated with the QueryResult I got, e.g: the Obi Rope object.

Is there any way of doing that?

Just to give you an idea, here's my current code, based on the example, that uses the mouse position and successfully returns a relevant QueryResult 

Code:
if (Input.GetMouseButton(0))
        {

            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            Debug.Log("X: " + ray.origin.x + "Y: " + ray.origin.y + "Z: " + ray.origin.z);
            Debug.DrawRay(ray.origin, ray.direction * 1000);

            int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);

            // perform a raycast, check if it hit anything:
            if (obiSolver.Raycast(ray, out QueryResult result, filter, 50, 0.1f))
            {
                // get the start and size of the simplex that was hit:
                int simplexStart = obiSolver.simplexCounts.GetSimplexStartAndSize(result.simplexIndex, out int simplexSize);

                // Debug draw the simplex:
                for (int i = 0; i < simplexSize; ++i)
                {
                    int particleIndex = obiSolver.simplices[simplexStart + i];
                    Vector3 pos = obiSolver.transform.TransformPoint(obiSolver.positions[particleIndex]);
                    Debug.DrawRay(pos, Vector3.up * 1000, Color.yellow);
                }
            }
        }


Thank you.

OK so I think I actually find out how to do it, essentially by using simplexStart, using it to find the particleIndex, and finally, using "particleToActor" with the particleIndex to fetch the ObiRope GameObject.

Here's how my current code looks like:
Code:
        if (Input.GetMouseButton(0))
        {

            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            Debug.Log("X: " + ray.origin.x + "Y: " + ray.origin.y + "Z: " + ray.origin.z);
            Debug.DrawRay(ray.origin, ray.direction * 1000);

            int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);

            // perform a raycast, check if it hit anything:
            if (obiSolver.Raycast(ray, out QueryResult result, filter, 50, 0.1f))
            {
                //obiSolver.particleToActor
                // get the start and size of the simplex that was hit:
                int simplexStart = obiSolver.simplexCounts.GetSimplexStartAndSize(result.simplexIndex, out int simplexSize);

                int particleIndex = obiSolver.simplices[simplexStart];

                ObiRope rope = obiSolver.particleToActor[particleIndex].actor as ObiRope;

            }


I'm not sure if this is the optimal method. If Anyone has a better suggestion, I'd love to know about it.

Thanks.

Print this item

  Character + cloth
Posted by: aqualonix - 20-12-2021, 05:08 PM - Forum: Obi Softbody - Replies (7)

So, if I want to simulate softbody character with socks for example. What is the best approach? Should I use separate mesh with the same bones or just one character mesh without leg parts but with socks instead? Or maybe I can somehow skin wrap (attach) socks to soft body character even without bones?

Sorry for that many questions  Triste
But is there any way to forcefully update blend shapes for a softbody mesh? I don't care for performance so I can wait for the update.

Print this item

  Fluids not recognizing holes in terrains
Posted by: Softscale - 20-12-2021, 11:28 AM - Forum: Obi Fluid - Replies (1)

I've got a regular Unity terrain in my game world, with a Terrain Collider and Obi Collider, and fluid collision works fine in most places - but in one part, there is a hole cut in the terrain for a cave mesh. I've noticed that fluids won't cross the threshold where the hole in the terrain was painted, and any fluids created inside the cave (below where the terrain would be) are immediately forced upward/outward to the surface of the terrain.

I did find a workaround that works for my use case (disable the ObiCollider on the terrain when in the cave) but I'm wondering if there is a better solution for being below a terrain. Thanks.

Print this item

  Spatial Query on multiple Actors
Posted by: cgwill - 20-12-2021, 09:35 AM - Forum: General - Replies (2)

Hello,

i have recently started to work with the Obi Package (Rope/Cloth) and am running in some trouble. It is probably a pretty simple fix/problem but i simply am unable to figure it out myself. I used the code example for spatial query which is working really perfectly as long as only one actor is in the solver. As soon as multiple actors from the same type are in the solver the position data is calculated wrong. It stays correct with the last actor in the solver though, which i find curious. 

Code:
using UnityEngine;
using Obi;

public class DistanceToPoint : MonoBehaviour
{
    public ObiSolver solver;
    public float radius = 1;

    void Update()
    {
        int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);

        var query = new QueryShape(QueryShape.QueryType.Sphere, Vector3.zero, Vector3.zero, 0, radius, filter);
        var xform = new AffineTransform(transform.position, transform.rotation, transform.localScale);

        QueryResult[] results = solver.SpatialQuery(query, xform);

        // Iterate over results and draw their distance to the point.
        // We're assuming the solver only contains 0-simplices (particles).
        for (int i = 0; i < results.Length; ++i)
        {
            if (results[i].distance < radius)
            {
                Vector3 pos = solver.transform.TransformPoint(solver.positions[results[i].simplexIndex]);
                Debug.DrawLine(transform.position, pos, Color.yellow);
            }
        }
    }
}

Here is a GIF of the problem

Any suggestions why this might be? Does this concern the info in the example code (We're assuming the solver only contains 0-simplices (particles))?

A follow up question would be. I plan on using multiple solvers with multiple actors in my scene and would keep the performance overhead low. What would be the best query method to check which actor/particles are near. Is the spatial query method suited for this purpose?

Any help would be highly appreciated Sonrisa

Best regards, Will

Print this item

Pregunta Connect dynamic rope attachment to another rigidbody object
Posted by: ghawstie - 17-12-2021, 01:10 PM - Forum: Obi Rope - Replies (3)

I am trying to make a first person grappling hook mechanic using obi rope. The rope is attached dynamically to an object which is the fire source, which is the child of the camera which I placed inside of the player object (which has a rigidbody). On the other end it is statically attached.
Right now I managed to make it work almost as it should: I added a fixed joint to the fire source, which links it to the camera; the camera also has a fixed joint which links it to the player.
The grappling itself is working, the issue is that jumping and ground movement now feel very clunky because of the player object's two childs (camera and fire source) which now have rigidbodies... How can I improve this? Or are there better ways of doing this overall?

Here's a link to a google drive folder with some screenshots and a video: https://drive.google.com/drive/folders/1...sp=sharing

Print this item

  Not displayed in scene
Posted by: kbtit - 17-12-2021, 09:04 AM - Forum: Obi Fluid - Replies (2)

I was able to eject a Particele using Solver and Emitter.

Now I want to eject more than one Particele, so I duplicate the Solver and Emitter.
The Particele is ejected, but not displayed in GameView, and not displayed in ScneView before duplication.

How do I get the Particele to show up in GameView and ScneView?

Print this item

  Should I use Cloth or Rope package?
Posted by: jingato - 17-12-2021, 05:04 AM - Forum: General - Replies (2)

Hi. I have a simple basketball game and I want to add some physics to the net when the ball interacts with it, including going in the hoop and out the net. My net consists of a single mesh and uses a texture with alpha to make it look like rope. To achieve this, would it be better to use the cloth package or the rope package? Also, would one perform better than the other for this use case. It will need to run on the Oculus Quest 2, which isn't all that powerful. Is that achievable?

Thanks

John

Print this item