Drag and Drop Problem with Perspective View

I am making a drag and drop puzzle game and finished coding my drag and drop script. I drag my object from gui to a world point using Camera.main.ScreenToWorldPoint. But because of the perspective view, there are some problems. The object appears off and sometimes goes through objects. Maybe this is because I am raycasting?

I don’t think there is a problem with my code… and I don’t want to do orthographic view. So how can I make my objects drop from my mouse at a fixed amount away from the mouse position?


Assuming you are creating the object where you are instantiating the prefab all you’d need to do is have the object face the camera and then move forward by whatever amount you feel appropriate,

there are other ways of doing this but this seems to be your best bet without looking at your code :smiley: