#Cursor guiding camera with panning view ? (Stationary First Person)

3 messages · Page 1 of 1 (latest)

shy comet
#

Welcome,

In the Inspector of Camera2D there is Limit. Here, you can, surprise, surprise, set limits to camera movement. It's in pixels. Setting those properties to your background size will act as borders you describe.

In Camera2D, also, there is Drag, within Drag, Margin (for 4 directions). They create an invisible box centered within field of view, when the parent node of this camera move into this box nothing happen, when it reach an edge (of this invisible box) camera start moving. Values go from 0 to 1, 0 is center and 1 the edge of this direction (ex : drag_top_margin = 1 mean that the player need to reach the very top of the field of view to make the camera move upward ; set to 0 and the camera move with every upward movement)

You will need to parent your camera to a node that follow mouse cursor.

PS Both properties can be set via code.

shy comet
#

It could be a simple Node2D or anyone which inherite from it. You just need a position property

shy comet
#

Limits don't work?