Window Mode / Borders unpassable for objects

Hey Guys!

I just started my journey to Unity, so please, I know nothing.

That said, I have this very small game I run in window mode, but I can drag my player object around and basically “out” to all edges. How can I prevent this?

Did not find anything, if there is a thread mea culpa…

Thanks

A simple fix would be to check the mouse coordinates and then restrict them to the screen dimensions when you feed it into the screen to world method of the camera.