I have a side-scrolling game idea where the player must switch lanes to avoid obstacles. How would I make it so that only objects in the same lane [as the character] can interact/collide? At first I thought the game would need to be 3D, but then I saw this clip from an obviously 2D Sonic game: You can see that he goes around the platform to collect more rings. This isn't a very good example of dodging obstacles in other lanes, but it's the closest representation I've found for what I'm trying to do.
What do you mean? If I do that, the player could just jump and hit the collision shapes of objects in other lanes (Which I don't want)