Bug / Crash ObiColliders not working with scripted ropes - 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: Bug / Crash ObiColliders not working with scripted ropes (/thread-3036.html) |
ObiColliders not working with scripted ropes - PeachyNotFound - 28-07-2021 Hi there, This is my first post here, apologies if it's in the wrong place or if I'm just doing something very silly... I think have come across an issue with the Obi Collider script. Both of the sample scenes I have found where the ropes are generated through scripts (RopeGrapplingHook & RopeNet samples) do not collide with the environment, despite Obi Collider script components being present on the relevant game objects (environment mesh for RopeNet and level geometry for RopeGrapplingHook). I have tried a number of different settings to enable collision between ropes generated from scripts but nothing has worked collision obi collider thicknesses, obi rope surface based collision, various distance fields, collision margins in the Obi solver, etc. In summary, when using GrapplingHook.AttachHook() for rope creation, collisions do not work. When using ropes created via the Unity inspector (not from scripts), everything seems to work fine. Should be able to repro by observing RopeNet demo dropping below the environment in the latest version of the ObiRope package (v6.2). Thanks! RE: ObiColliders not working with scripted ropes - josemendez - 29-07-2021 Make sure collision filters are properly setup. From our FAQ: Quote:I set up colliders as explained in the manual, but I can´t get Obi objects to collide with them. Is this a bug? When building a path for the rope to follow, one of the arguments for AddControlPoint is the filter. This is a 32-bit integer where the 16 most significant bits define the collision mask, and the 16 less significant bits define the category. You can build the filter yourself using bitwise operations, and there's also helper functions if you don't want to mess with bits yourself. ObiUtils.MakeFilter will create the filter for you given a mask and a category. For instance: Code: int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything,0); This builds a filter for category 0 that allows the rope to collide with everything. RE: ObiColliders not working with scripted ropes - PeachyNotFound - 30-07-2021 Thank you! The filter works like a charm. Also, thanks for the reference - I'll read through the FAQ before posting again |