In ACTION GAME MAKER, various camera behaviors can be configured using the dedicated camera node ZoomCamera2D.
Following an Object
ZoomCamera2D follows objects that have a
target_id
matching the one specified in the camera settings.
- Add a CameraTargetSettings node as a child of the object you want the camera to follow.
- Set an arbitrary string as the target_id in the CameraTargetSettings node.
- In the ZoomCamera2D node, specify the same target_id you want the camera to follow.
Following Multiple Targets
When multiple targets are specified (either multiple objects have the same target_id, or multiple target_id values are assigned):
- The camera will automatically move to keep all targets within view.
- If Auto Zoom is enabled, the camera will also adjust the zoom level automatically within a defined range to ensure all targets remain visible.
CameraTargetSettings Configuration
- Target ID: A customizable string used to match with the camera’s follow target.
- Enable: Disabling this option will stop the camera from following this target.
- Size: Defines the area around the object (from its origin point) that the camera should always include, helping prevent targets from being clipped when multiple are present.
All of these properties can be changed dynamically using the Change Object Property action.
Limiting Camera Movement
Camera movement can be constrained using the Limit property under ZoomCamera2D > Camera2D.
- Limits define the range from the scene origin in which the camera can move.
- For example, setting Top/Bottom = 0 will lock the camera’s vertical movement while still allowing horizontal movement.
By combining this with Offscreen conditions in visual scripts, you can create mechanics such as “Game Over if the player falls off-screen.”
Switching Between Multiple Cameras
In addition to the InitialCamera, you can add multiple ZoomCamera2D
nodes within the same scene.
However, to use these additional cameras with Visual Script, some setup is required:
Steps:
- Select the GameScene node.
- In the Inspector panel, expand the
CameraList
property. - Click the + Add Element button to add a new camera slot.
- Click the Assign button and select the
ZoomCamera2D
node you want to register.
Once registered, you can switch cameras during gameplay using the “Change Camera” action in Visual Script.