Skip to content

Latest commit

History

History
17 lines (9 loc) 路 742 Bytes

draggable-camera.md

File metadata and controls

17 lines (9 loc) 路 742 Bytes

Draggable Camera

To enable dragging a Camera2D, you can attach the draggable-camera script to any Camera2D Node.

Setup

Create a Camera2D node, and look for the draggable-camera script to it from the Inspector.

Now, if you add a TextureRect as a sibling of the Camera2D, you'll be able to drag it to move the camera.

Boundaries

(Experimental) Adding a sibling ReferenceRect called boundaries allows boundaries to be set for the camera.