2D Overhead view: Walking on an overpass

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kanor

I’ve got a problem trying to make this work. I’ve got a character able to go under this overpass. Easily done with Z-index, BUT I want to also use the stairpath on the left to go ONTO the overpass. I’m not sure how I can do that efficiently. Especially since I’m using tilesets.

My main problem is collision. ESPECIALLY if there’s a monster on the overpass, you shouldn’t be able to collide with it unless you go ONTO the overpass. Any ideas?

Layers

:bust_in_silhouette: Reply From: avencherus

You can have a pair of Area2Ds at the entries / exits masked to enemies and players. When touching one heading out, it would set their Z-index to the ground level number, and when touching the one heading in, would set their Z-index to the upper level number.