Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runtime Rope Generation
#2
Hi,

You need to pass appropriate collision filters to your control points. right now you're just passing "1" as the filter, which may or may not generate collisions depending on the filters set on your colliders.

Check out "collision filtering" in the manual:
http://obi.virtualmethodstudio.com/manua...sions.html

Also check the AddControlPoint function in the API docs. You can either build your filters manually using bitwise operators, or use Obi's MakeFilter() helper function.

Filters are made of a mask and a category. The mask is the first parameter of the ObiUtils.MakeFilter() function. Just keep in mind the mask is a bit mask (just like Unity's layer masks), so you build it by simply or'ing together bits. For instance, to build a mask that collides with categories 1, 3, and 6:

Code:
int mask = (1 << 1) | (1 << 3) | (1 << 6);
int filter = ObiUtils.MakeFilter(mask, 0); // used category 0, could use any other.

If you want a filter that collides with everything:
Code:
int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);

Note you need to be familiar with bitwise operators to understand this. If you're not sure what this means, look them up. There's many tutorials around dealing with bit manipulation (in C# as well as other languages), the above link to Unity's layer masks is a good starting point as they work just like Obi's filter masks.
Reply


Messages In This Thread
Runtime Rope Generation - by mnholbart - 04-12-2021, 09:54 AM
RE: Runtime Rope Generation - by josemendez - 06-12-2021, 10:32 AM
RE: Runtime Rope Generation - by mnholbart - 06-12-2021, 09:01 PM
RE: Runtime Rope Generation - by Reydans - 07-12-2021, 10:35 AM