Obi Collider and Jump - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: Obi Collider and Jump (/thread-3749.html) |
Obi Collider and Jump - grinog4 - 29-01-2023 Hello. Thank you for a wonderful product . I have a question. I'm using a sphere (RubberBall) as a character with Softbody Controller. On various game objects I put a Obi Collider script. The problem is that I can use "jump button" off all surfaces even vertical ones, can I somehow mark that this is not the ground? . Best. RE: Obi Collider and Jump - josemendez - 30-01-2023 (29-01-2023, 10:36 AM)grinog4 Wrote: Hello. Thank you for a wonderful product . I have a question. Hi! You do this the same way you would for any other game in Unity. There's many ways to determine whether a collider as "ground" or not, none of them specific to Obi (since Colliders are part of Unity, the ObiCollider component simply tells Obi to use a specific collider). Here's 3 different methods you can use: - Put the collider in a specific layer, then in your code check whether the collider is part of that layer or not. This is probably the simplest method but also the most cumbersome to use. - Send a raycast downwards from the position of your softbody, see if it hits any collider to determine whether there's something directly below it. - Check the contact normal of the surface you're colliding against, and calculate its slope to determine whether it's horizontal ground or something else. let me know if you need further help, kind regards |