I dont know how to explain it so im just gonna show it with a picture
the player(red box) doesnt hide behind the tree completely for some reason, watched a lot of videos but none of them had this problem. this happened after adding Z index to the player so the character moving a bit from the tree could apear infront of it. before that it was fine.
So, you have set z_index of a player to have it on top of the tree? How would it hide behind it then.
I suppose what you want to do is to change z_index dynamically, as the player moves up and down the screen, so that when it is lower than a tree it appears on top of its sprite, and when it is higher it is placed behind.
yeah I actually fixed it. the problem was with the trees tileset, it wasnt 1 box, it was made of hundreds of boxes. by fixing that the problem went away