Obi Official Forum
Help 'ObiCollider' does not contain a definition for 'idToCollider' - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help 'ObiCollider' does not contain a definition for 'idToCollider' (/thread-2449.html)



'ObiCollider' does not contain a definition for 'idToCollider' - nimdanet - 26-08-2020

Hi!

I just updated to ObiRope 5.5 (it was 4.1) and some structure changed and I needed to make some code adaptations. Normal process. But one error I couldn't replace. 'ObiCollider' does not contain a definition for 'idToCollider'. I opened ObiCollider.cs and indeed this propery is no longer there. On documentation it still teach to get collitions through 'idToCollider' and I can't figure it out how to make without it. I didn't see anyone here with this problem so I might be doing something wrong.

I updated from Unity Asset Store. I removed completly Obi folder and imported again from scratch.

Can anyone help me on this?

Thanks


RE: 'ObiCollider' does not contain a definition for 'idToCollider' - josemendez - 26-08-2020

(26-08-2020, 03:57 PM)nimdanet Wrote: Hi!

I just updated to ObiRope 5.5 (it was 4.1) and some structure changed and I needed to make some code adaptations. Normal process. But one error I couldn't replace. 'ObiCollider' does not contain a definition for 'idToCollider'. I opened ObiCollider.cs and indeed this propery is no longer there. On documentation it still teach to get collitions through 'idToCollider' and I can't figure it out how to make without it. I didn't see anyone here with this problem so I might be doing something wrong.

I updated from Unity Asset Store. I removed completly Obi folder and imported again from scratch.

Can anyone help me on this?

Thanks

Hi there,

In 5.5, there's no longer any need to map from id to collider. You can directly access the collider using its index in the ObiColliderWorld singleton object. For instance, to get the collider involved in a contact:

Code:
ObiColliderWorld.GetInstance().colliderHandles[contact.other].owner

We're still updating the docs regarding this. Let me know if I can help you further.


RE: 'ObiCollider' does not contain a definition for 'idToCollider' - nimdanet - 26-08-2020

Perfect! I changed the code and looks good. I can't test it all for now because I need to recreate the rope because of this update and since Xcode 11.6 is bugged with the link I decided to postpone this game launch and wait for Xcode 12.1 with the bugfix.

But wow, thanks for the fast reply!  Corazón