2DPlatformer-Tutorial icon indicating copy to clipboard operation
2DPlatformer-Tutorial copied to clipboard

Slope Transition Issue

Open jakeklassen opened this issue 9 years ago • 4 comments

First off, great tutorials!

Has anyone noticed any issues when transitioning between slopes and the collisions data? Specifically the status of collisions.below?

Using my own copy and the source code from the repo produces the same following results (watch the output of the Below box):

Scene Gif

Notice the quick switch between true/false? It's made it somewhat unreliable to use any animation states between grounded to falling. Any help is appreciated.

jakeklassen avatar Nov 25 '15 11:11 jakeklassen

I'm developing this tutorial more, fixing some bugs, can you please check if it still happens @ https://github.com/llafuente/unity-platformer

llafuente avatar Apr 04 '16 13:04 llafuente

First off, great tutorials!

Has anyone noticed any issues when transitioning between slopes and the collisions data? Specifically the status of collisions.below?

Using my own copy and the source code from the repo produces the same following results (watch the output of the Below box):

Scene Gif

Notice the quick switch between true/false? It's made it somewhat unreliable to use any animation states between grounded to falling. Any help is appreciated.

did you ever figure out a solution for this? having the same exact issue, i know its been a long time :p

mathijs-dr avatar Dec 10 '19 22:12 mathijs-dr

Unfortunately no, I ended up going with a tile based approach like those mentioned in http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/

jakeklassen avatar Dec 12 '19 18:12 jakeklassen

Just for anyone reading this in the future, i fixed this by adding an extra groundcheck below the players feet.

if (!Physics2D.OverlapArea(leftFoot.position,rightFoot.position,obstaclesLayermask)) playerAnimator.SetBool("inAir", true);

could probably do it better with raycasts,, im just happy my animations dont change for that 1 frame anymore :p

mathijs-dr avatar Dec 13 '19 13:12 mathijs-dr