Manual: Camera Settings

In ACTION GAME MAKER, you can make various settings using the dedicated camera node ZoomCamera2D.

Object Following Method

ZoomCamera2D follows objects that have a target_id matching the one you set.

  1. Add a CameraTargetSettings node as a child of the object you want to follow.
  2. Specify any name for the target_id in the CameraTargetSettings node.
  3. In the ZoomCamera2D node, specify the target_id name you want to follow.

Following Multiple Targets

When multiple targets are specified by target ID (e.g., multiple objects with the same target ID or multiple target IDs specified), the camera will move to keep all targets within the screen. If the “Enable Zoom” option is enabled, the camera will automatically zoom and scale within the specified range.

CameraTargetSettings Settings

  • Target ID: Can be specified as any string.
  • Enabled Setting: If disabled, the camera will no longer follow the target.
  • Size: Prevents cutoff when multiple targets are set. The camera will move so that the specified size range from the origin is always within the camera view.

These properties can be modified using the “Change Property” action. Note that the camera follows the “CameraTargetSettings position” rather than the object itself. Therefore, moving the CameraTargetSettings will also shift the follow position. Be careful, as shifting it left or right may cause the camera to move when flipping.

Limiting Camera Movement Range

The camera movement range can be set using the Camera2D > Limit property in ZoomCamera2D.
The camera can move within the specified range from the scene’s origin.
For example, setting Top/Bottom values to 0 will allow horizontal movement but restrict vertical movement.

Combined with visual scripting’s offscreen detection, you can set up scenarios such as game over when the player falls out of the camera view.

Switching Between Multiple Cameras

You can add a new ZoomCamera2D node in addition to InitialCamera to have multiple cameras in the same scene, but pre-setup is required for use in visual scripting.

  1. Select the GameScene node.
  2. Expand the CameraList in the inspector.
  3. Click the “Add Element” button to add a camera frame, then press the assign button to specify the added ZoomCamera2D node. A camera ID will be automatically assigned. (In the attached image, InitialCamera is assigned ID 0.)
  4. You can now switch cameras using the “Change Camera” action in visual scripting. The “Change Camera” action requires specifying the camera ID from the camera list.