Different animations change layers

I’m making a 2D RPG game and i’m making a fence that is on a lower layer than the player. But when I walk across the fence it looks like it changes the layer to higher than the player. Is this a bug or can I fix this somehow?


Well it was my mistake because the fence and the player were on the same layer. It’s fixed now.