Issue with slopes in unity 2D, can't find solution.

Hello everyone,

Me and a friend have true brainscratcher here.
We are pretty new to the game, pun IS intended.
Altough my friend is a veteran in coding and finish his PHD as we speak.

I’ll try to explain.

We made slopes using tilemaps with the knowledge we have and looking at other games.
Our character controller uses raycast to check for collision and slopes.
Yes,it is based on Sebastian Lagues great work for the controller.

Now we find 2 issues:

  1. if we come from a flat surface transitioning to a slope, and only then, our character controller thinks its are falling. We could see this in the animation but were able to mask that with timing, yet our console clearly tells us trough some code that our character falls during that transition. We do not want that. For it gives weird animations if we remove the masking.

  2. When standing on a slope and facing the upward side you can quickly moving to the downward side of the slope and the character will shoot off a bit and start falling of the slope. Like that movement gave it a boost. If you would face the downward side while standing on a slope and keep moving downward, this would not happen.
    We want it to keep stuck to the slope UNLESS it is to steep. (this mechanic is already in the code.)

Do you guys have the knowledge to fix this? Especially issue 1 is driving us crazy. We try to prototype other stuff but can’t shake off the feeling of not being able to fix this dumb issue. Will you help?

I will post the project so u guys can fiddle around, maybe give us newbies some tips and tricks for future stuff.

Thanks for taking the time to read.
Many respect and thanks in advance!

Marimba

WeTrasnfer link to project:
link text

Even though it’s late, someone might be helpful.