Search Forums

(Advanced Search)

Latest Threads
Request a different way t...
Forum: Obi Fluid
Last Post: spikebor
1 hour ago
» Replies: 2
» Views: 15
Obi7 | Ropes make fluid s...
Forum: Obi Fluid
Last Post: josemendez
Yesterday, 07:21 PM
» Replies: 3
» Views: 33
Unable to load DLL 'Oni'.
Forum: General
Last Post: josemendez
Yesterday, 05:52 PM
» Replies: 3
» Views: 37
I contact with softbody b...
Forum: Obi Rope
Last Post: spikebor
Yesterday, 02:34 PM
» Replies: 2
» Views: 39
Need the positions to dri...
Forum: Obi Fluid
Last Post: spikebor
Yesterday, 02:19 PM
» Replies: 2
» Views: 39
Frequent crash after assi...
Forum: Obi Fluid
Last Post: spikebor
Yesterday, 02:15 PM
» Replies: 9
» Views: 211
Problems deleting obi col...
Forum: Obi Rope
Last Post: josemendez
Yesterday, 08:05 AM
» Replies: 7
» Views: 123
When I use ObiBone with m...
Forum: Obi Rope
Last Post: josemendez
Yesterday, 07:58 AM
» Replies: 3
» Views: 40
Changing solver gravity v...
Forum: Obi Fluid
Last Post: T-1000
13-05-2024, 10:08 PM
» Replies: 2
» Views: 27
Usando ejemplo del Rollin...
Forum: Obi Fluid
Last Post: josemendez
13-05-2024, 07:48 AM
» Replies: 1
» Views: 47

 
  Does Obi Disregard Convex Mesh Colliders?
Posted by: virtushda - 16-08-2020, 11:28 PM - Forum: Obi Cloth - Replies (7)

It's my understanding that a convex mesh collider is considered non-hollow and much more performant than a standard mesh collider, at least inside PhysX.
Obi does not seem to care about that however...

I know about and love Obi's SDF colliders, but no support for non-uniform scaling is a huge deal-breaker for our use-case.

Setup: All convex and primitive colliders!
[Image: BrPQRhV.png]

Results: Yes this setup works perfectly with SDF collision!
[Image: oN3J89c.png]

Print this item

  Obi Fluid with Sprites.
Posted by: FoxButler - 16-08-2020, 08:28 PM - Forum: Obi Fluid - Replies (1)

Hello,

I was doing a few preliminary tests with Obi Fluid and sprites, It would appear that fluid transparency doesn't work on sprites or at least it doesn't with my tests.

I placed a sprite 2d and a plane mesh side by side behind(Z) a simple fuild simulation, The mesh with a default diffuse material applied could be seen through the transparant liquid but the sprite is completely rendered over and can't be seen, I'm guessing this is a limitation of the default sprite shader since a standard material works just fine.

My question is if Obi Fluid can be used on 2d Projects which primarily use sprites how can I achieve rendering fluid on top of sprite with transparancy? Would I need a custom shader or am I missing something real obvious?

Thanks for any help in advance Sonrisa .

Print this item

  Boxing Ring Rope
Posted by: ebruins - 14-08-2020, 05:48 PM - Forum: Obi Rope - Replies (1)

Hi there,

I've been playing about a bit with Obi Rope and have been trying to get a Boxing Ring like rope setup.

I've tried using a rod, but i was just wondering how performant it would be to have 16 ropes in a scene.

Our game is currently using HDRP and we have some really high fidelity art assets, so we dont really want to be losing too much performance for ropes.

Also do you have any suggestions as to how to optimize ropes to make them more performant?

Print this item

  Rope as Cable
Posted by: Marev - 14-08-2020, 08:58 AM - Forum: Obi Rope - Replies (1)

Hey, I have a problem with attaching rope between 2 objects. It should work as cable so there is device on one end and plug on the other. I added 2 "Obi Particle Attachment" component to my rope and setuped it that near Device is static and near plug is Dynamic. I put contraint in Obi Solver so it wont stretch to much. And it works decent. Only problem I have is that when I pick up device and plug is flying in air then that obi rope is detaching and following a plug. Logic behind it works coz plug doesn't drop on ground and looks like it's rope is keeping it in contrained distance but rope is detaching it self visualy from the plug.

Is there any work around with that? I was trying to put one Attachment on particle group closer to plug on static and on a bit fruther the rope dynamic but then plug isnt draged by rope.

Print this item

  Need Help On Render Chain at RunTime
Posted by: huahuapro - 14-08-2020, 06:14 AM - Forum: Obi Rope - Replies (2)

Hi, I want Render a Chain at Run Time, but I got this.


NullReferenceException: Object reference not set to an instance of an object
Obi.ObiRopeChainRenderer.CreateChainLinkInstances (Obi.ObiRopeBase rope) (at Assets/ThirdParty/Obi/Scripts/RopeAndRod/Rendering/ObiRopeChainRenderer.cs:98)
Obi.ObiRopeChainRenderer.UpdateRenderer (Obi.ObiActor actor) (at Assets/ThirdParty/Obi/Scripts/RopeAndRod/Rendering/ObiRopeChainRenderer.cs:116)
Obi.ObiActor.Interpolate () (at Assets/ThirdParty/Obi/Scripts/Common/Actors/ObiActor.cs:1016)
Obi.ObiSolver.Interpolate (System.Single stepTime, System.Single unsimulatedTime) (at Assets/ThirdParty/Obi/Scripts/Common/Solver/ObiSolver.cs:1351)
Obi.ObiUpdater.Interpolate (System.Single stepDeltaTime, System.Single accumulatedTime) (at Assets/ThirdParty/Obi/Scripts/Common/Updaters/ObiUpdater.cs:119)
Obi.ObiFixedUpdater.Update () (at Assets/ThirdParty/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:79)



I don't know what's wrong.

here is My code:

thanks for the help.

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;


public class HookTool : MonoBehaviour
{

    public ObiSolver solver;
    public ObiCollider character;
    public float hookExtendRetractSpeed = 2;
    public bool canTear;
   
    public ObiRopeSection section;

    //public GameObject chain;
   
    private List<GameObject> PrefabsList;

    ObiRope rope;
    private ObiRopeBlueprint blueprint;
    private ObiRopeExtrudedRenderer ropeRenderer;
    private ObiRopeChainRenderer chainRenderer;

    private ObiRopeCursor cursor;


    KeyCode interKey = KeyCode.Joystick1Button0;
    KeyCode addRope = KeyCode.Joystick1Button4;
    KeyCode lessRope = KeyCode.Joystick1Button5;

    private bool attached = false;

    private GameObject maincam;
    private bool doOnce;
    private SpeedTutorInspectSystem.ObjectController raycastedObj;

    RaycastHit hit;
   

    void Awake()
    {
       
        //找到玩家身上的主攝像機
        GameObject camobject = GameObject.FindGameObjectWithTag("MainCamera");
        maincam = camobject;

        //這裡學到一個超牛的,之前我沒有給chain初始化,public GameObject chain並沒有定義,下面必須初始化,否則後面的一切,update都不會觸發!
       
        PrefabsList = new List<GameObject>();

        //GameObject instance = Instantiate(Resources.Load("ChainLinkRed", typeof(GameObject))) as GameObject;

        GameObject instance = Resources.Load("ChainLinkRed", typeof(GameObject)) as GameObject;
        PrefabsList.Add(instance);
       
       

        // Create both the rope and the solver:    
        rope = gameObject.AddComponent<ObiRope>();
        chainRenderer = gameObject.AddComponent<ObiRopeChainRenderer>();
       
        chainRenderer.linkPrefabs = PrefabsList;
        chainRenderer.linkScale = new Vector3(34,34,34);
        chainRenderer.twistAnchor = 0;
        chainRenderer.sectionTwist = 70;
       
       

        // Setup a blueprint for the rope:
        blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
   
        blueprint.resolution = 0.5f;

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

        // Add a cursor to be able to change rope length:
        cursor = rope.gameObject.AddComponent<ObiRopeCursor>();
        cursor.cursorMu = 0;
        cursor.direction = true;
    }

    private void OnDestroy()
    {
        DestroyImmediate(blueprint);
    }


    public void LaunchHook()
    {
        //以後都是從整個class讀取ray
        hit = maincam.GetComponent<SpeedTutorInspectSystem.InspectionRaycast>().hit;

        if (hit.collider.CompareTag("InteractObject"))
        {
            //Debug.Log("hit" + hit.collider.gameObject.name);
            StartCoroutine(AttachHook());
            //yield
            chainRenderer.enabled = true;
            chainRenderer.twistAnchor = 0.2f;
        }
       
    }


    private IEnumerator AttachHook()
    {
        //Debug.Log("hook begin");
        yield return 0;
        Vector3 localHit = rope.transform.InverseTransformPoint(hit.point);

        // 將rope由兩點畫出來:
        blueprint.path.Clear();
        blueprint.path.AddControlPoint(Vector3.zero, -localHit.normalized, localHit.normalized, Vector3.up, 0.1f, 0.1f, 1, 1, Color.white, "Hook start");
        blueprint.path.AddControlPoint(localHit, -localHit.normalized, localHit.normalized, Vector3.up, 0.1f, 0.1f, 1, 1, Color.white, "Hook end");
        blueprint.path.FlushEvents();

        // 畫出rope的blueprint:
        yield return blueprint.Generate();

        // 設置兩點的交互,rope對物體的影響在這裡設置:
        var pinConstraints = blueprint.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
        var batch = pinConstraints.batches[0];
        batch.AddConstraint(0, character, transform.localPosition, Quaternion.identity);
        batch.AddConstraint(blueprint.activeParticleCount - 1, hit.collider.GetComponent<ObiColliderBase>(),
                                                          hit.collider.transform.InverseTransformPoint(hit.point), Quaternion.identity);
                                                         
        batch.activeConstraintCount = 2;
       
       
        // 最終顯示出來.
        rope.ropeBlueprint = blueprint;
        chainRenderer.enabled = true;
        rope.tearingEnabled = canTear;
        rope.selfCollisions = true;
        // 這裡是讓物理正常
        pinConstraints = rope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
        batch = pinConstraints.batches[0];
        batch.stiffnesses[0 * 2 + 1] = 10000;
        batch.stiffnesses[1 * 2 + 1] = 10000;
       
        //rope.GetComponent<ObiRopeChainRenderer>().enabled = true;
        //chainRenderer.twistAnchor = 0.1f;
       
       
    }

    public void DetachHook()
    {
        // Set the rope blueprint to null (automatically removes the previous blueprint from the solver, if any).
        rope.ropeBlueprint = null;
        chainRenderer.enabled = false;
        //rope.GetComponent<ObiRopeChainRenderer>().enabled = false;
    }


    void Update()
    {
       
        //如果用getkey的話就會一秒內按無數次,必須是Getkeydown才可以!gfg
        if (Input.GetKeyDown(interKey))
        {
           
            if (!rope.isLoaded)
            {
                LaunchHook();
            }
               
            else
                DetachHook();
        }

        if (rope.isLoaded)
        {
            if (Input.GetKey(lessRope))
            {
                cursor.ChangeLength(rope.restLength - hookExtendRetractSpeed * Time.deltaTime);
            }
            if (Input.GetKey(addRope))
            {
                cursor.ChangeLength(rope.restLength + hookExtendRetractSpeed * Time.deltaTime);
            }
        }

        if (Input.GetKeyDown(KeyCode.P))
        {
            //chainRenderer.enabled = true;
            chainRenderer.twistAnchor += 0.1f;
            //chainRenderer.gameObject.SetActive(true);
        }
    }
}

Print this item

  Grab Rope - VR
Posted by: zig420 - 13-08-2020, 05:30 PM - Forum: Obi Rope - Replies (56)

Hello,
I'm trying to grab a obi rope with my hands in VR (oculus rift). I can't figure out how to do it.... I can't find any tutorial or guidance on how to do it. I spent days trying to implement Nizmo's script posted in 2017 (http://obi.virtualmethodstudio.com/forum...ad-82.html) and it just doesnt work.
I'm a pretty experienced VR developer, so just a high level of what I need to do would suffice.
Any help would be greatly appreciated.

Print this item

  Explosion force on fluids
Posted by: Spectra_7 - 13-08-2020, 02:42 PM - Forum: Obi Fluid - Replies (2)

Sorry for dumb question, but is it possible to add explosion force on fluids?

Setup:
I have a simple spoon animation that comes smashing down on fluids. That's where I want to create an explosion force.

Print this item

  Grappling hook with tilted camera
Posted by: illustrator - 13-08-2020, 09:51 AM - Forum: Obi Rope - Replies (4)

I noticed that grappling hook in the grappling hook demo does not seem to work if I tilt the camera. Hook does not connect to the objects on the scene. Huh

Print this item

  Fluid Color problem
Posted by: Spectra_7 - 12-08-2020, 01:57 PM - Forum: Obi Fluid - Replies (2)

Hello.

I am having problem with few colors of the particles. Screenshot below:
[Image: s4wTE6T.png]

In the above screenshot, below buttons selects color of fluid. I set the color of fluid from ObiEmitterDiskShape component via script.
The problem is if I select purple color, it still drops blue colored fluid like in screenshot above. Same happens when I select yellow color, but it drops in red color.

Thanks.

Print this item

  Multiple terrains collision issue
Posted by: memoryofgod - 12-08-2020, 01:46 PM - Forum: Obi Rope - Replies (2)

I'm having some issues with terrain collision when using multiple terrains. Although all terrains have the Obi Collider script attached to them, and collision works fine on individual terrains, when terrains are stitched together the rope appears to fall beneath the world at the seam between the two.

Any ideas how to overcome this?

Print this item