gets in front of the chest

then stops at...

also happens when the character goes behind it

however wen i try something like this in gdevelop the character can only be stopped at the edges like this.


how can i get the character to stop only after it gets in front or behind the object?