player slides THROUGH slopes

I’ve been working on a game using unity 2D for a while now and I keep running into this issue whenever I try to use slopes:

The character slides down and through them for some reason. I would prefer to not have the player slide across them at all unless they already have momentum, but that seems to be a separate issue. I have tried several things, including setting the gravity to 0 and the rigidbody to kinematic when not moving, but this all causes other issues or doesn’t fix the problem at all. I need help.

To further complicate things, I’m using visual scripting. I know that isn’t ideal but it helps me to see everything on a graph rather than just lines of code.

I’ve never used visual scripting so I really don’t know what you can or cannot do with it, but I have 2 suggestions:

  • Using a capsule collider for you character is usually going to work better if you’re using slopes (as most of the time there will be a single collision point between character and ground).
  • In case it exists use whatever node is equivalent to method Rigidbody2D.Slide, as that will keep you character tied to the ground regardless of slopes.

On the other hand, I think you should post a picture of the script you’re using to move your character (although I’m not sure how easy will it be to read) so someone can better diagnose your problem.

This should be my entire movement script