Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect Collider
#1
Hello everyone, I haven't done anything I want to do on Unity:
I could not find how to use this code with Soft Body without using colliders. In Unity, ready colliders (boxes, sphere) do not sit properly on the object.


private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "Glass")
        {
            CreateLittleWaters();
            Destroy(gameObject);
        }
        else if (collision.gameObject.tag == "Floor")
        {
            Destroy(gameObject);
        }
    }
Reply
#2
Hi,

Obi is a separate physics engine, so it does not use Unity's collision callbacks but its own. See the manual:
http://obi.virtualmethodstudio.com/tutor...sions.html
Reply
#3
yes, I tried it, but I am having a problem with how to adapt the code there to the code I wrote myself.
Reply
#4
Could you elaborate on that?
Reply
#5
I want to know if an object hits another object. If unity's ready colliders can't work properly, I can't check it with the OnCollisionEnter method. How can I do this check using Obi SoftBody.

ObiColliderWorld gives an error.
My Unity version is 2020.1.5, VS is 2019
Reply
#6
Hi,

There's a full example of doing this in the manual, that you can copy-paste. You should subscribe to the solver's OnCollision event, and then iterate over the contacts looking for whatever colliders you need.

ObiColliderWorld should not give any errors, unless you're using Obi 4.X. Can you post the errors you're getting?
Reply
#7
Obi SoftBody version is 5.1

Added attachment that is screenshare. But I guess the SS is not visible Triste
Reply
#8
You should update to Obi 5.6. There's many bug fixes and performance improvements since 5.1.

If you're using 5.1, see this page instead:
http://obi.virtualmethodstudio.com/tutor...sions.html

There's no attachment to your last post. Just try posting a link to your image.
Reply