Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two Quick Beginner Questions
#5
(19-08-2019, 09:15 PM)HenryChinaski Wrote: Ok, I found the error. It is just that I thought that collider.transform.gameObject.tag would reference the tag of the gameObject that 
hit the SoftBody, but it references the SoftBody itself. So is it not possible to get the ObiCollider that collided with a SoftBody?
I see no other way to make the SoftBodies really interactable.

I also want to buy Obi Ropes and Cloth as soon as possible, because overall this is an amazing asset. Still, even the best assets need some
explanation to the user.

Best regards,
Daniel

Hi Daniel,

To get the ObiCollider that hit a soft body, simply use the idToCollider map, as in the docs (see "Retrieving the collider involved in a contact"):
http://obi.virtualmethodstudio.com/tutor...sions.html

then just use GetComponent<ObiCollider>() on the Collider.

Anyway your code seems fine to me. The tag returned by collider.transform.root.gameObject is the one at the collider's root transform, so if you compare it to "Player" it should return whether the collider root is a player or not. Note this is standard Unity behavior and not dependant on Obi in any way.
Reply


Messages In This Thread
Two Quick Beginner Questions - by HenryChinaski - 05-08-2019, 01:53 PM
RE: Two Quick Beginner Questions - by josemendez - 07-08-2019, 01:41 PM
RE: Two Quick Beginner Questions - by josemendez - 20-08-2019, 10:04 AM
RE: Two Quick Beginner Questions - by josemendez - 20-08-2019, 05:22 PM