Help Rope not colliding with other ObiColliders - 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 Rope not colliding with other ObiColliders (/thread-3262.html) |
Rope not colliding with other ObiColliders - bubbbles - 08-01-2022 Hello, I am facing an issue when I generate a ObiRope in script which is used in RopeNet example (please see attached video) Everything works fine but the generated rope does not collide with the Ground or anything else which has an ObiCollider. Normal rope when created in editor collides as expected with the ground. Is there something I'm missing in the settings? Please help. Thanks, Abhi Code: public void GenerateRope(Vector3 pointA, Vector3 pointB, ObiCollider start, ObiCollider end) RE: Rope not colliding with other ObiColliders - pdinklag - 08-01-2022 You need to setup collision filter masks in both the rope and each of your colliders. By default (when creating Obi actors from script), they're all set to zero so nothing colliders. ObiUtils has a static MakeFilter function for that. Let's say you want your ropes to be in category 0 and your colliders in category 1, then you'd do this: Code: obiRope.filter = ObiUtils.MakeFilter((1 << 0) | (1 << 1), 0); // put rope in category 0 and make it collide with categories 0 (ropes) and 1 (colliders) This really seems to be missing in the docs, I had to dig through Obi's code myself to find this. It should be added here: http://obi.virtualmethodstudio.com/manual/6.3/scriptingactors.html Also, note that the term "filter" seems to be new. The online version of the API is still at version 6.0 and there it's still called "phases" or so, that also needs updating for sure. RE: Rope not colliding with other ObiColliders - bubbbles - 09-01-2022 Thanks a lot that worked perfectly RE: Rope not colliding with other ObiColliders - josemendez - 10-01-2022 (08-01-2022, 01:15 PM)pdinklag Wrote: This really seems to be missing in the docs, I had to dig through Obi's code myself to find this. It should be added here: http://obi.virtualmethodstudio.com/manual/6.3/scriptingactors.html Thanks for the feedback! It's explained in the particle scripting page, however the only explanation given is: Code: Integer value used for collision filtering. Less significat 16 bits contain a collision category (from 0 to 15) and most significant 16 bits contain a collision mask. See collisions. Which is a bit lackluster indeed. While you could build a filter yourself using bitwise operators with this info, no mention of the helper stuff (MakeFilter(), CollideWithEverything, & co) was made. I've just added a section at the end of the scripting collisions page that explains these in greater detail and provides some examples. Also linked to it from the scripting actors page, so that it's easier to find when you're looking for info on creating ropes at runtime. Let me know if you have any input about this! |