Entity preserves z value while keeping xy during dragged by mouse


Is there a way to keep height of the entities while it is dragged and follows the mouseXY?

I’m wondering if it is about with Camera angle but I have no idea.

You might find helpful to show the solution with the bad example below

Any advice is appreciated, thanks.