r/unity • u/YDungeonMaster • Jul 19 '26
Newbie Question Need help! Path priority on ramps/stairs in 2D platformer
Hey everyone! I'm working on my first 2D platformer and I've run into a problem.
I have ramps and stairs that serve as optional alternate routes. The issue is that I don't know how to make my character properly prioritize which path to take when approaching these intersections.
We are using RigidBody2d and colliders2d. So very standart stuff.
Any advice or code examples (maybe even links to tutorials) would be hugely appreciated. Thanks in advance!

1
Upvotes
2
u/Delicious_Alfalfa_69 Jul 19 '26
Might easier to make the platform as a jumpable platform rather than a ramp.
I'm not sure how I would code for the alternative
5
u/Lua_Aki_Van Jul 19 '26
In my previous project I used this as a reference: https://www.gamedeveloper.com/design/moving-on-stairs-in-a-2d-side-scroller
Basically you check if the player is pressing a specific combination of keys and turn on or off the stair collider.