Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ObiRope: 2D
#1
Hello guys, how to use it in 2d game?
I saw that all tutorials is about 3d game creation and no any tutorial about 2d game.
I tried to Add Pin Constraint but it requires Obi Collider and not Obi Collider 2d.

[Image: Unity%2B2017.1.1f1%2BPersonal%2B%252864b...IZWFB73RSA]

I used 2d Mode in rope Parameters:
[Image: Unity%2B2017.1.1f1%2BPersonal%2B%252864b...IZWFB73RSA]


Can you give me information how to pin 2d object to the rope?
Reply
#2
(15-01-2018, 08:19 PM)naoma Wrote: Hello guys, how to use it in 2d game?
I saw that all tutorials is about 3d game creation and no any tutorial about 2d game.
I tried to Add Pin Constraint but it requires Obi Collider and not Obi Collider 2d.

[Image: Unity%2B2017.1.1f1%2BPersonal%2B%252864b...IZWFB73RSA]

I used 2d Mode in rope Parameters:
[Image: Unity%2B2017.1.1f1%2BPersonal%2B%252864b...IZWFB73RSA]


Can you give me information how to pin 2d object to the rope?

Hi!

This is a typo in our code, and a very critical one by the way.

Luckily it is very easy to fix. Both ObiCollider and ObiCollider2D inherit from ObiColliderBase. So it's enough to do a couple modifications:
-In ObiPinConstraintsBatch.cs, replace all appearances of "ObiCollider" with "ObiColliderBase" (there are two, lines 16 and 46).
-In ObiPinConstraintsEditor.cs, replace all appearances of "ObiCollider" with "ObiColliderBase" (there are two, both in line 68).

that's it, pin constraints should now accept 2D colliders. This typo will be fixed in the next version. Sorry about that!
Reply
#3
It works! Thank you!
Reply
#4
(16-01-2018, 10:34 AM)naoma Wrote: It works! Thank you!

But I found another one issue. 
When I pin some GameObject with RigidBody2D to the rope in 2dMode the rope stretches with infinity length.
Probably ObiCollider2D has some bugs.
Reply
#5
(16-01-2018, 12:03 PM)naoma Wrote: But I found another one issue. 
When I pin some GameObject with RigidBody2D to the rope in 2dMode the rope stretches with infinity length.
Probably ObiCollider2D has some bugs.

What you're asking for is two-way coupling between the rope and the rigidbody. This is only supported for 3D rigidbodies in 3.2, but we have added support for 2D too in 3.3 (unreleased). This means that in 2D rigidbodies will always pull the ropes with them and the ropes will not respond by pulling back.

I'm providing you a patch so that you can do what you need without waiting for an official release, you'll find it attached. Here's the link:
https://we.tl/WbRqJmSFDN
The patch contains these changes:

- 2 files modified: ObiRigidbody, ObiColliderBase
- 2 new files added: ObiRigidbody2D, ObiRigidbodyBase

After applying this patch, the rope should be able to resist the force applied by the rigidbody, allowing it to hang from the rope. Let me know if you encounter any issue while applying it.

cheers!
Reply
#6
Thanks!
When rope v3.3 will be available on AssetStore?
Reply