Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Adding points to Obi Rope in rune time
#7
(19-06-2020, 11:48 AM)davidsedrakyan Wrote: I guess I understand now, I will check this out, meanwhile I have another one question, I'm just learning all the obi stuff!)

So question is, I need call on 3d object some sort of "OnCollisionEnter()" function, like in normal unity physics, for example when cube collides with rope I want to deactivate cube, or add force to the cube, like in unity collision detection system, some sort of OnCollisionEnter function, where can I get info about that?

You can get a list of all contacts in a frame by subscribing to the solver's OnCollision event:
http://obi.virtualmethodstudio.com/tutor...sions.html

New contacts (OnCollisionEnter), contacts that have disappeared (OnCollisionExit) and persistent contacts (OnCollisionStay) can easily be identified using set operations like Except (https://www.dotnetperls.com/except).

That is, you keep the list of contacts from the previous frame, and the current list of contacts. Perform an Except between the two, and you get all contacts that are in the new frame that weren't in the previous frame. This is how Unity generates these events internally too.
Reply


Messages In This Thread
RE: Adding points to Obi Rope in rune time - by josemendez - 19-06-2020, 12:05 PM