0 votes

I started designing of an isometric dungeon game.

I have a problem because the player sometimes appears through the walls.

I tried to change the setting "Tile Origin" but then the problem moves to another side.

I think of an YSort problem

Main Scene
Node2D
--->TileMap # Grounds ZIndex 0 TileOrigin Centered Isometric 256x128
--->TileMap # Walls ZIndex 1 TileOrigin Centered Isometric 256x128
------>YSort
--------->Player # Zindex 0 Z As Relative

And Scene Player

KinematicBody2D
--->AnimatedSprite
--->CollisionShape2D
--->Camera2D

Any idea?

asked May 1 in Engine by Dzandaa (19 points)

1 Answer

0 votes

I had some problems (2D platformer) using YSort + Node (Node for container... Enemies for example, and inside that Node every enemy). The YSort breaks

My approach was make an excel with "node" "z index" for memory and ZIndex calculations, and not touching any YSort on Godot, just managing ZIndex
So... for example

Tilemap World --> -100 ZIndex
Player --> 100 ZIndex
Enemy --> 50 ZIndex
Objects --> 20 ZIndex

and so...

The "big" values are in case I need to add something between

Not ideal but works for me

Of course this can be a mess with relative ZIndex and calculation if you dont get track of values (in my case that excel is mandatory for this).

answered May 2 by Omar13 (164 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.