06-12-2021, 10:32 AM
(This post was last modified: 06-12-2021, 10:35 AM by josemendez.)
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:
If you want a filter that collides with everything:
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.
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.