Search Forums

(Advanced Search)

Latest Threads
Problems deleting obi col...
Forum: Obi Rope
Last Post: btduser
3 hours ago
» Replies: 2
» Views: 34
Frequent crash after assi...
Forum: Obi Fluid
Last Post: spikebor
Yesterday, 09:59 AM
» Replies: 4
» Views: 144
Softbody for head Model s...
Forum: Obi Softbody
Last Post: josemendez
11-05-2024, 07:52 AM
» Replies: 1
» Views: 25
Bigger foam with Alpha di...
Forum: Obi Fluid
Last Post: spikebor
10-05-2024, 08:57 AM
» Replies: 12
» Views: 402
Changing the rope's posit...
Forum: Obi Rope
Last Post: Crystalius
09-05-2024, 08:54 AM
» Replies: 3
» Views: 103
RESET Obi Softbody
Forum: Obi Softbody
Last Post: spikebor
09-05-2024, 06:12 AM
» Replies: 11
» Views: 2,872
Obi7 | Fluid granular can...
Forum: Obi Fluid
Last Post: spikebor
08-05-2024, 06:17 PM
» Replies: 0
» Views: 63
Can ObiBone work with Sof...
Forum: Obi Softbody
Last Post: spikebor
08-05-2024, 03:36 PM
» Replies: 0
» Views: 42
(7.0) Still confused abou...
Forum: General
Last Post: kodra
07-05-2024, 03:13 PM
» Replies: 4
» Views: 170
Question of the ObiRope l...
Forum: Obi Rope
Last Post: rinrin
07-05-2024, 02:33 PM
» Replies: 0
» Views: 117

 
  Teleport() causing ArgumentOutOfRangeException error
Posted by: HakJak - 20-03-2024, 05:07 AM - Forum: Obi Softbody - Replies (1)

Hello,

I was using Teleport() to reset out of bounds players and noticed it kept throwing an ArgumentOutOfRangeException error each time (ObiSoftbody.cs Line 189).  
I'm using Unity 2022.3.21f1 and a fresh install of the latest Obi Softbody asset on a basic project.  

I updated the script as show below (duplicated and commented out old for comparison).  It got rid of the error, but I'm not sure if it's correct or could cause other problems.  Please advise.  

Code:
for (int j = 0; j < ac.batches[i].activeConstraintCount && j < ac.GetBatchCount(); ++j)
{
    sc.batches[j].orientations[batchOffset + i] = rotOffset * sc.batches[i].orientations[batchOffset + j];
}

//for (int j = 0; j < ac.batches[i].activeConstraintCount; ++j)
//{
//    sc.batches[j].orientations[batchOffset + i] = rotOffset * sc.batches[i].orientations[batchOffset + j];
//}


Thank you

HakJak

Print this item

Pregunta Spawning a rope along a line the player draws
Posted by: joegatling - 20-03-2024, 12:25 AM - Forum: Obi Rope - Replies (2)

Hello, I am trying to create a game where the player can draw a rope in realtime by dragging the cursor around.  My goal is:

  1. Let the player drag the cursor around a 2D plane, spawning a rope as they go (as if drawing a line with a pen)
  2. The rope should spawn in a way that it matches the drawn path as closely as the simulation settings allow.
  3. The rope should be a live simulation while it is being drawn (I don't want to draw a spline and then convert it into a rope once the cursor is released).
   

Below is a code snippet from my first approach, but it doesn't seem to work. Here is a YouTube video of it in action.

Code:
void FixedUpdate()
{
    // _dragAndDrop is an object that follows the cursor if isDragging is TRUE
    if(_dragAndDrop.isDragging)
    {
        // Calculate the distance between _tipTransform and _dragAndDrop.transform
        float distance = Vector3.Distance(_tipRigidbody.transform.position, _dragAndDrop.transform.position);

        // Add that amount of distance to the end of the rope
        _cursor.cursorMu = 1.0f;
        _cursor.sourceMu = 0.0f;
        _cursor.ChangeLength(_rope.restLength + distance);

        // Tip rigidbody is attached to the end or the rope.               
        _tipRigidbody.transform.position = _dragAndDrop.transform.position;
    }
}

The code sort of works, but it seems to spawn too many particles. And then the rope just explodes. It would appear that changing the length in any way causes at least one new particle to be added. 
Is there a better way to achieve this?

Print this item

  Constraints unexpected behaviour in build
Posted by: natko1412 - 19-03-2024, 11:56 AM - Forum: Obi Rope - Replies (4)

Hi,

I have a rope with static attachment on one side and dynamic on the other. The rope should not stretch as there is an object on the dynamic attachment end. In editor, I can achieve that - distance constraints seem to work very well, even with low number of substeps (6). I can get the object hanging and the rope not stretching.

As soon as I build and run this example, the rope just stretches indefinitely with the object falling down (without changing the code).
I have tried with more substeps, but nothing seems to fix the issue in build.

Can you help me identify the problem? What are some of the things that you think can cause this behaviour?

TLDR; Different behaviour (distance constraints) in Editor and Build

Thanks in advance

Print this item

  Rope stretch problem
Posted by: Agony - 19-03-2024, 07:13 AM - Forum: Obi Rope - Replies (5)

Hello, I am making a rope length real-time update project, encountered some problems, I hope I can get help
Below is the method to dynamically change the length of the rope, which is performed in the Update, which cannot be changed。

Code:
public void ChangeRopeLength()
{
    restLength = Rope.restLength;
    currentLength = Rope.CalculateLength();
    diff = currentLength - restLength;

    if (diff > m_StretchThre)
        restLength += diff * Time.deltaTime * m_StretchSpeed;

    if (diff < m_ShortenThre)
        if (restLength > startLength)
            restLength += diff * Time.deltaTime * m_ShortenSpeed;

    m_RopeCursor.ChangeLength(restLength);

    ropeLength = Rope.restLength;

    //m StretchThre is 0.1,m_ShortenThre is -0.1,m_StretchSpeed and m_ShortenSpeed is 50.
}
This method only works if I set the value of Distance Constraints to 0.5 or less. If I set it to 1, the rope will stretch indefinitely. Even if I changed the m StretchThre in the top code to be large enough, it wouldn't work as well as I wanted.
I wonder what method I can use to change the rope length in Update when I change the Distance Constraints to 1,So that the length of the rope can be normal variation, rather than infinite elongation

Print this item

  Are there any examples of a rigidbody climbing an ObiRope?
Posted by: gnovos - 17-03-2024, 07:48 AM - Forum: Obi Rope - Replies (2)

I went through the ExtendableGrapplingHook example, but that is "climbing" by changing the length or the rope, which isn't quite what I'm looking for.  I'm looking more for something that just moves a rigidbody steadily up a rope while maintaining the two-way forces between the two.  I have a few ideas how I could accomplish this, but if there's already an example somewhere to save me a lot of trial and error, I would be very grateful.

Print this item

  Rope resolution inconsistency resulting in larger forces required
Posted by: inbilla - 17-03-2024, 05:25 AM - Forum: Obi Rope - Replies (8)

I have two ropes defined.
Each has a different starting shape. Because they have a different initial shape, they must have different blueprints. 
They both have the same settings in the blueprint though, in particular, they both have a resolution = 0.206
(See attached initial state image)
   

During runtime, I use a RopeCursor to increase the length of both ropes to ~20.0.
I use a character to drag the ends around and stretch them out.

The issue is... 
The character can successfully drag one of the ropes, but not the other.
This leads to an inconsistent gameplay experience based upon the starting state of the rope.

To debug the issue, I attached a particle renderer and discovered that the rope that cannot be dragged has significantly more particles than the other.
(See attached runtime image)
   
The rope with red particles cannot be dragged by my character (the force required is too great).
The green particle rope behaves well.

I suspect that the fact the red rope has more particles is why they require more force to move?

Some questions arise:
 - Why does the red particle rope have more particles? (I suspect because I required more control points in the initial shape to create the starting coil shape)
 - Is there a way that I can make sure both ropes have the same inter-particle distance regardless of the starting shape?
 - Alternatively, is there a way to make sure the force required to move each rope is consistent? (lower the friction on the red particles somehow?)

Thanks for your assistance

Print this item

  Android (Pico) Virtual Reality and OBI Fluid
Posted by: ugurcamoglu35 - 15-03-2024, 01:38 PM - Forum: Obi Fluid - Replies (2)

Hi,

I encounter an error when I operate the obi in the container with the Pico hand controller. I put xr grab objects into the cup object. As soon as I hold the glass via the controller, the liquid disappears. When I release the controller, the fluid comes back.

Is there something I missed somewhere?

Print this item

  Problem with movement of ObiRopeAttachment
Posted by: Alnik - 13-03-2024, 02:42 PM - Forum: Obi Rope - Replies (2)

Hello everyone!

I have the following problem: I am trying to control the same crane with two clients that connect to a server via FishNet. As long as no player connects to the crane, the ObiSolver remains disabled and the spreader is simply dragged along as a child of the crane.

As soon as a player connects to the crane, the parenting of the spreader is changed and the ObiSolver is enabled so that the spreader is now only attached to the crane by the ropes. It should be noted that the ropes themselves are attached to a SpreaderAttachmentGO in a cabin GO that can be moved.

If you now move the cabin, the spreader also moves with it, as the SpreaderAttachment, just like the VCam, is attached to the cabin. If the first client now disconnects from the crane, the ObiSolver is disabled again. If the second client then connects to the crane, the VCam is packed to the position left by the first client, but the ropes spawn at the original position in the centre of the crane, i.e. as if the cabin movement had not taken place before. You can see this in the attached video.

What confuses me now is that in the SceneView (also in the video) you can see that the object on which the ropes are actually hanging is in the correct position, but for some reason the ropes themselves are hanging down vertically from the centre.

I was previously able to reproduce this behaviour independently of the network, i.e. in single player, but this was not always successful. The same behaviour can also be observed when the crane is moving. The ropes also spawn at the crane's point of origin.

Does anyone know what could be the reason for this? Does the position of the SpreaderAttachment have to be updated somehow in the ObiSolver? Could the alternating enable/disable of the ObiSolver lead to such behaviour? Originally I installed these changes because the performance was severely affected by the rendering of 60 different ObiSolvers for all cranes at once.

In the video, I also included the settings for the ObiSolver and for one ObiRope as an example.

Many thanks in advance!

Best regards,
Alexej


Print this item

  Performance with Burst on is very bad
Posted by: ShawnF - 13-03-2024, 11:19 AM - Forum: General - Replies (14)

I'm getting a major performance hit from my obi ropes, and it's significantly worse when using the Burst as the backend rather than Oni. FPS is ~75 with all ropes disabled, 30 with Burst, and 40 with Oni. 

Using Unity 2022.3.13f1

I've got 11 ropes in the scene - each has its own solver. 

So the story is...
After looking into some performance issues today, I noticed that our obi ropes were the biggest offender. I googled around and realized that I didn't have all the packages installed that I needed for it to use Burst, which should theoretically improve performance a lot. I installed what I needed and I no longer got the package dependency warning, but performance tanked badly. At that point, I was getting an error similar to the one here:
http://obi.virtualmethodstudio.com/forum...-3492.html

I do have the Jobs debugger, safety checks, and leak detection all disabled.

I've tried a few different things to improve performance. It helped a bit, but still isn't good enough. Specifically what I've done is:
- Reduced solver steps from 4->3
- Reduced rope resolution
- Increased decimation

Also tried switching to the line renderer instead of extruded mesh, but that didn't make a difference, presumably because the performance issues are coming from the simulation rather than the rendering.

I also tried installing the old Jobs package individually, but that didn't seem to make any difference either.

Let me know if you want any specific profiling info - I wasn't sure what would be useful and didn't want to flood this post with unnecessary info.

I suspect that my best bet for a big improvement is getting the Burst backend to work properly, but something is definitely wrong there. Any ideas what might be the issue and how I can solve it?

Print this item

  Using Fluid for cooking simulation?
Posted by: stepkka - 11-03-2024, 10:06 PM - Forum: Obi Fluid - Replies (4)

Thinking about purchasing Obi Fluid. I assume some soup in pot would be easy to do. But I also have an idea of making eggs. When you crack an egg the insides are liquid (though somewhat viscous). When you pour an egg into a flat surface it should behave like a normal egg, i.e. stay as a clump and not disappear. After cooking it should become more rigid (ideally increase viscosity smoothly over time). Is it possible to do using Obi Fluid?

Print this item