AppleyAppley Docs
Docs/API Reference

Camera API

Control the game camera.

8 min read Intermediate Updated 2026-07-01 v2.0 ~23 min to complete

Introduction

Control the game camera. This page provides a complete guide to camera api in Appley, covering everything from setup to advanced techniques.

API Reference is a core area of Appley. Understanding camera api will help you build better games and use the platform more effectively. This documentation is designed for intermediate level users.

Requirements

Before working with camera api, ensure you have the following:

  • An Appley project with scripts
  • Familiarity with Appley Scripting syntax
  • The API reference documentation
  • Understanding of namespaces (player, world, audio, ui)

Estimated Completion Time

This guide takes approximately 23 minutes to complete. The estimated reading time is 8 minutes. Difficulty level: Intermediate.

Step-by-Step Guide

Follow these steps to work with camera api in your Appley project:

1

Read the documentation

Review the camera api reference in these docs. Note method names and parameters.

2

Open the Script Editor

Switch to the Script tab in Creator Studio.

3

Use autocomplete

Type the namespace name and press Ctrl+Space to see available methods.

4

Write the code

Call the API methods with correct parameters. Check return types.

5

Test and debug

Use debug.log() to verify API outputs. Fix any errors in diagnostics.

FluxScript Example

Below is an Appley Scripting (Flux Scripting) code example demonstrating camera api:

Camera API — Appley Scripting
// API Reference — Camera API
on start {
  // Player API
  player.setPosition(0, 10, 0)
  player.setHealth(100)
  player.setSpeed(8.0)
  
  // World API
  world.spawn("enemy", 5, 0, 5)
  world.setTime(14, 30)
  
  // Audio API
  audio.play("bgm", { volume: 0.7, loop: true })
  
  // UI API
  ui.setText("label", "Hello")
  ui.setBar("health", 0.8)
  
  // Math API
  dist = math.distance(player.pos, target.pos)
  angle = math.atan2(dy, dx)
  clamped = math.clamp(value, 0, 100)
  
  // Effects API
  effects.spawn("explosion", pos, { scale: 2.0 })
  
  // Save API
  save.set("inventory", inventory)
  data = save.get("inventory")
  
  // Scene API
  scene.load("level2")
}

Node Script Example

The same logic can be implemented using Node Scripting. Here is the equivalent node graph:

Camera API — Node Graph
[On Start] ──► [Player.setPosition]
         ──► [World.spawn: enemy]
         ──► [Audio.play: bgm]
         ──► [UI.setText: label]
         ──► [Math.distance]
         ──► [Effects.spawn: explosion]
         ──► [Save.set: inventory]
         ──► [Scene.load: level2]

Interchangeable Systems

FluxScript and Node Scripting compile to the same runtime. You can mix both in a single project — use whichever is best for each task.

Common Mistakes

Avoid these frequent mistakes when working with camera api:

Not checking API return values

Validate returns from find/get methods before using them.

Calling expensive API methods in on update

Cache results and only call when needed.

Not reading the API documentation

Check method signatures and return types in the docs popover.

Mixing up similar method names

Use autocomplete to verify exact method names and parameters.

Troubleshooting

If you encounter issues with camera api, try these solutions:

Method returns undefined
Check the method exists in the current API version. Verify the namespace.
API call throws an error
Read the error message. Check parameter types. Ensure target object exists.
Method behaves differently than documented
Ensure you are on the correct Appley version. Check deprecated methods.
Autocomplete shows wrong methods
The script parser may have an error. Fix syntax errors.

Performance Tips

Optimize your use of camera api with these performance tips:

  • Use autocomplete (Ctrl+Space) to discover available methods and parameters.
  • Check return types in the docs popover before using API results.
  • Cache API results in variables instead of calling methods repeatedly.
  • Use the debug API for logging during development: debug.log().

Explore these related documentation pages:

Example Project

Download a complete example project demonstrating camera api: