how do i make the level in the foreground and the background, like in paper mario the thousand year door how if you go through a pipe or somn it will take you to the background. i tried putting a tilemap in the background but no matter how far back i put it, i can still interact with it. the only other thing i can think of is turning off the collider of the background while in the foreground and vice verca (however you spell that) please help
All the Paper Mario games are 3D, so it’s not really comparable as-is. A closer comparison, incidentally, would be Virtual Boy Wario Land, since that game did have a distant background available to play on, but the game itself was entirely 2D.
That said, in both cases, the foreground and background elements were effectively two independent gameplay regions (with more-variable controls schemes in Paper Mario games, as well, when it switches between 3D- and 2D-based movement schemes). Plus, neither of those were using an all-purpose game engine with built-in physics engine designed explicitly for realistic physics interactions (tumbling objects, etc.).
One way to effectively try and replicate that in this case of effectively largely-intersecting environments (without disabling/enabling a ton of colliders, anyway) would be to put foreground elements on a “foreground” layer, background elements a “background” layer, then swap characters between other layers with carefully controller collision groupings.
For example, 6 layers could give you something like:
foreground environment (non-combative stuff, basically)
background environment
foreground player (the player and player's attacks/projectiles)
background player
foreground enemy (enemies and enemy attacks/projectiles)
background enemy
Then, by preventing foreground and background physics objects from colliding with each other, you can still let enemies on the opposing plane attack blindly for aesthetic as desired.
The downside with this approach is that you basically max out at availableLayers / 3 planes to make use of, in case you’d want more than just two (foreground/background). By extension, if you do intend to make use of that many gameplay planes, then you’d probably be better off just using that same 6 layers as “active” and “inactive” variants, and changing layers by way of a parent-container per gameplay plane and a script to perform cascading layer changes.
thank you so much. it works ![]()