Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Creating a list of all gameobjects currently in contact with ObiRope
#1
Lengua 
As the title says, I would like to be able to find all objects currently colliding with the obirope. I'm sure I could figure it out myself with a bit of time, but I'd figure I'd ask before making something that might already exist within the asset. 

Also, I just wanted to say that this asset rules, absolutely the bomb dot com 5 stars
Reply
#2
(27-10-2021, 04:47 AM)Faffy_Waffles Wrote: As the title says, I would like to be able to find all objects currently colliding with the obirope. I'm sure I could figure it out myself with a bit of time, but I'd figure I'd ask before making something that might already exist within the asset. 

Also, I just wanted to say that this asset rules, absolutely the bomb dot com 5 stars

Hi there! Thanks for your kind words Sonrisa

You can do this using collision callbacks:
http://obi.virtualmethodstudio.com/manua...sions.html

You subscribe to the solver's OnCollision event, and then iterate trough all contacts generated by the solver. You get a lot of information about each contact, including the specific particle and collider component involved in it. See "Retrieving the collider involved in a contact" in the link above for some code that retrieves the collider for a given contact.

Also, the first code snippet in "Some examples" does basically what you need, you can just copy-paste it.

let me know if I can be of further help.
Reply