As the title says, I am using Unity6000 0.5f1.
I imported Obi Fluid and followed the manual, but in every sample the fluid turns black and I keep getting warnings.
Based on troubleshooting, URP15/16 patches have already been applied.
I converted the material for URP and set the RendererFeature as instructed on the setup page.
Hello,
I happen to be in the middle of a VR hackathon and I've been tasked with developing a stretchy arm for our first person player. I would like to apply custom hands and forearm to the player skeleton and add the ability that when they grab something, they can outstretch their arms like "elastic man" to position the object far away from them. It also would be nice if I could a apply a bit of curve and flexibily to the arm. But the hand should still be able to have it's basic vR functions untinterrupted.
I mostly use Obi rope for cable and rope simulations but it occurred to me that I could try the stretch + Bone components in my scenario. I would just need to know for sure if it's realistic thinking that I can access the stretch distance parameters via thumbstick controller if I wanted.
I would appreciate any tips or ideas in this direction while I continue trying to hack it out based on documentation.
Thanks much
Here's a reference I found of someone with a different type of mechanic using stretchy arms... I wish to make something that is more slow and controlled. https://www.youtube.com/watch?v=nM81-lH79YE
The documentation for cloth proxies says that they should be usable with either skinned cloths or normal cloths, however from looking at the code it seems like it's being driven from the MeshFilter component, which isn't a requirement of the SkinnedMeshRenderer.
is there an alternative?
Edit: Additionally, this cloth solution doesn't have a clear way of how to manage LODGroups. The results seem to be that any cloth will always be visible, breaking the lodgroup
As shown in the figure below, I try to use two soft bodies to grab a rigid body. For example, a claw machine.I expect the grabbing process to be achieved through friction.
I set the same collision material for both the claw soft body and the rigid body, with both dynamic and static friction set to 1.
In my attempt, I was able to grab the rigid body, but it soon fell slowly. In the real world, I would think that the friction is not enough. But I have set the friction to 1 in the collision material, and I expect that there should be no tangential movement of the object.
For reference I have attached my Obi Solver component configuration, although I have tried different things with it and I don't think the problem seems to be there.
Is it possible to achieve my needs based on ObiSoftbody? If it is feasible, I am very much looking forward to getting suggestions from developers.
Many thanks!
Please see the attachment for detailed configuration.
Thanks!
Any guide or example on making a rope that works like a helicopter hook, ie bit like the jungle strike games.. where the end of the hook can latch onto gameobjects to pick them and swing them, but also hoist them up so the rope length would get shorter?
is this something simple that can be done with obi rope?
I've a rope around 1 unit long, it's attached to a rod by the first and last particle with 2 static particle attachments.
On this rope there is cursor, depending on an object position (a VR controller) the cursor will either have the cursor at 0 or 1 (source always at .5) . Imagine you are pulling a rope either from the start or end.
So this rope can get bigger if you pull, everything works fine here.
Now when pulling I want to attach the closest particle from the controller to it. I'm getting the closest particle (avoiding the first and last) and create the attachment using this script:
And the behavior is weird, sometimes it works, sometimes points get stuck in the air like if they were attach to a world position. I feel like it's because I'm expanding the rope while dragging and sometimes the source particle can become the one attached?
I want to simulate human soft tissues through the ObiSoftbody toolkit.
I have two questions, both of which do not consider plastic deformation, but only elastic deformation:
① How to modify the elastic deformation effect of the soft body. For example, the elasticity of fat is different from that of muscle. I modified the Shape Matching Constraints in the test, but the effect does not seem to meet expectations.
② I want to simulate the elasticity value of each soft tissue, so I am considering obtaining the deformation of each particle through the API for calculation. Is my idea correct?
Thank you for your attention, I really want to know how to do my work, thank you.
Sorry to bother you. I want to create a system where when a cloth net collides with a rigid body, it indicates whether a collision has occurred. If a collision occurs, the scene should be reinitialized. However, with the current code, even though collisions appear to happen on screen, there is no indication of a collision being detected.
Here is the code attached to the obi solver,
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
[RequireComponent(typeof(ObiSolver))]
public class CollisionEventHandlerchuang : MonoBehaviour
{
ObiSolver solver;
public int contactCount;
private bool collisionOccurred = false;
// just iterate over all contacts in the current frame:
foreach (Oni.Contact contact in e.contacts)
{
// if this one is an actual collision:
Debug.Log("no bang chuang");
if (contact.distance < 0.01)
{
ObiColliderBase col = world.colliderHandles[contact.bodyB].owner;
if (col != null)
{
Debug.Log("bang chuang");
collisionOccurred = true;
contactCount++;
}
}
}
}
public bool IsCollisionOccurred()
{
return collisionOccurred;
}
public int GetContactCount()
{
return contactCount;
}
if (collisionHandlerchuang == null)
{
Debug.LogError("CollisionEventHandlerchuang not found in the scene.");
}
if (collisionHandler == null)
{
Debug.LogError("CollisionEventHandler not found in the scene.");
}
}
void FixedUpdate()
{
if (collisionHandlerchuang != null)
{
bool collisionOccurred = collisionHandlerchuang.IsCollisionOccurred();
int contactCount = collisionHandlerchuang.GetContactCount();
Dev environment: Obi Rope version 6.5.4 / Windows 10 / Unity 2021
Hello, sorry to bother you. I am working on a puzzle game and need to save the data of twisted ropes into a JSON file, then read the JSON during gameplay to restore the ropes to their previous twisted state. ()
I have implemented the save and load functions and can confirm that the saved data is correct because I have tested the vectors' paths of the ropes, and they match what was saved.
However, when I apply the data to the instantiated ropes, I cannot restore the ropes to their previous state. When I use the vectors stored in JSON to restore the positions of the rope's particles, the ropes can never maintain their previous twissted state. The ropes are always spread out or lying there alone.
I found some posts in the forum:
https://obi.virtualmethodstudio.com/foru...-116.html?
The first post from 2017 mentioned frequently calling ObiRopeCursor.ChangeLength() to restore the shape of the ropes, but this method does not work for me, and I am also unable to call the PushDataToSolver method mentioned in the post. (This method only implemented in class ObiStitcher) However, I understand the reason for calling ObiRopeCursor.ChangeLength(). Calling this method can increase the activeParticleCount. The number of actor.activeParticleCount may be much smaller than the number of actor.particleCount, but the number of actor.particleCount is limited by the particleCount in ObiActorBlueprint.
https://obi.virtualmethodstudio.com/foru...4112.html?
The second post was updated in February 2024, which is very recent and provides sample code. The save and load code in the post is very similar to mine, with the only difference being that the loop code during restoration ignores the legality of solver.positions[particlesIndices[i]]. During actual operation, the number of _rope.solverIndices may be much smaller than the total amount of data stored in JSON, resulting in either loss of some data or array out-of-bounds errors.
Here is the code I used to instantiate the rope / saving and restoring the ropes.
JSONObject GetRopeParticleData()
{
var rope = gameObject.GetComponent<ObiRope>();
var solver = rope.solver;
var particlesIndices = rope.solverIndices;
var positions = new List<Vector3>();
for (int i = 0; i < particlesIndices.Length; i++)
{
//if (rope.IsParticleActive(i)) // I was considering save active particles only.
{
positions.Add(solver.positions[particlesIndices[i]]);
}
}
var positionsArray = JSONObject.emptyArray;
for (int i = 0; i < positions.Count; i++)
{
positionsArray.Add((JSONNode)positions[i]);
}
var ropeObject = JSONObject.emptyObject;
ropeObject.AddField("positions", positionsArray);
//ropeObject.AddField("velocities", velocitiesArray); // Velocities are all zero, so I didn't save.
return ropeObject;
}
Load the positions of the particles from JSON and set to particles in the rope:
public void Actor_OnBlueprintLoaded(ObiActor actor, ObiActorBlueprint blueprint)
{
if (particleDataToRestore == null)
return;
var solver = actor.solver;
var particlesIndices = actor.solverIndices;
/*for (int i = 0; i < actor.solverIndices.Length; ++i)
solver.invMasses[actor.solverIndices[i]] = 0;*/
var positionsJsonArray = particleDataToRestore["positions"];
if (positionsJsonArray != null && positionsJsonArray.type == JSONObject.Type.Array)
{
for (int i = 0; i < positionsJsonArray.list.Count; i++)
{
if (i < particlesIndices.Length)
{
solver.positions[particlesIndices[i]] = positionsJsonArray[i].ToVector3();
// actor.ActivateParticle(i);
}
}
}
/*for (int i = 0; i < actor.solverIndices.Length; ++i)
solver.invMasses[actor.solverIndices[i]] = 1f;*/