We seem to have run into a bit of a problem with our collisions in our free-roaming world. I’d like to have two collision handlers driving one node: a pusher to keep the node out of walls (matched with a sphere), and a CollisionHandlerFloor to keep the player upright and drift them to the ground if they step off an edge (matched with a ray).
In general, this is working, but there are some sections of our world where we get badly stuck. In particular, the wall collider seems reluctant to allow the floor collider to do its job on slopes of about 45 degrees or more. We’re considering breaking out our collision geometry into two sets (“wall only” and “floor only”), which I believe would work. But if it were possible to get the system to work better the way we currently have it set up, that would, of course, be easier.
Is there a way to induce the collision sphere to “roll up” the wall instead of stopping dead? Is the size of the slope the issue? How can I determine the maximum slope beyond which my CollisionHandlerPusher won’t allow me to climb?
We’ve had to divide our geometry into “walls” and “floors”, using a different collision bit for each, to solve a similar problem. When a floor is steep enough to be detected as a wall, it’s going to cause problems no matter how you cut it.
A while back I made a prototype with a separation of ‘wall’, ‘floor’ and ‘both’. The ‘both’ was a special case which was handled like a floor and a wall such that the player would be able to walk on the surface, but the pusher would force the player to slide down the surface. The steeper the angle, the more the player would slide. Unfortunately I can’t find the code I made for it (it was a quickly made prototype and I didn’t end up using it). But I remember it wasn’t hard to make. You might be able to use the two collision handlers already defined for floor and wall and just add the bits for both of them to the special collision surface. One thing to note was that the ‘both’ type was specifically tailored for steep slopes. A flat slope might cause strange behavior (sliding on a flat surface).
I may have missed the mark on my last post. The ‘both’ type was for when I the player landed on prohibited terrain and would stop them immediately when they hit it or slide them back down, such as the problem you are having. But I did have slope control, using a smaller collision sphere with a floor bit that was attached to the pusher. I had this to originally help prevent falling through the floor. You can adjust the raduis and center of the sphere to allow for steeper slopes. The higher the center of the sphere and smaller radius, the steeper the slope you can walk up.
If you really want to try to use the single collision bit, raise the center of your wall sphere and/or shorten the radius. These values determine the value of the maximum slope you can walk up. You can also tweak the value of the collisionHandlerFloor’s offset. It would take some testing to get it right.