Hey guys,
I am working on an endless runner (sidescrolling) and my character has a basic movement script that detect ground with raycasts and a simple collision system that works simply as upon colliding with a collider tagged “obstacle”, the character will die.
The issue with this, is that some obstacle has a slope (see picture) and upon getting on it, as I have 3 raycasts downwards, I do stop falling, but as I continue to move to the right I collide with the obstacle and die.
Is anybody able to help me out with this, I’ve been trying front raycasts to calculate the angle of the slope and elevate player as he gets on it, but as soon as the first raycast is not in the slope anymore than I stop elevating and many other techniques that did not work…
Please share your ideas over here, I’ll be glad to get advices from you!